[S390] dasd: fix endless loop in erp

If not enough memory is available to build a new erp request it ended
up in an endless loop trying to build erp requests. Fixed the loop to
proceed the next request instead.

Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
This commit is contained in:
Stefan Haberland 2010-04-22 17:17:02 +02:00 committed by Martin Schwidefsky
parent 1ef6ce7a34
commit 6a5176c474
2 changed files with 8 additions and 2 deletions

View file

@ -1899,7 +1899,8 @@ static void __dasd_process_block_ccw_queue(struct dasd_block *block,
/* Process requests that may be recovered */ /* Process requests that may be recovered */
if (cqr->status == DASD_CQR_NEED_ERP) { if (cqr->status == DASD_CQR_NEED_ERP) {
erp_fn = base->discipline->erp_action(cqr); erp_fn = base->discipline->erp_action(cqr);
erp_fn(cqr); if (IS_ERR(erp_fn(cqr)))
continue;
goto restart; goto restart;
} }

View file

@ -2309,7 +2309,7 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr)
cqr->retries); cqr->retries);
dasd_block_set_timer(device->block, (HZ << 3)); dasd_block_set_timer(device->block, (HZ << 3));
} }
return cqr; return erp;
} }
ccw = cqr->cpaddr; ccw = cqr->cpaddr;
@ -2372,6 +2372,9 @@ dasd_3990_erp_additional_erp(struct dasd_ccw_req * cqr)
/* add erp and initialize with default TIC */ /* add erp and initialize with default TIC */
erp = dasd_3990_erp_add_erp(cqr); erp = dasd_3990_erp_add_erp(cqr);
if (IS_ERR(erp))
return erp;
/* inspect sense, determine specific ERP if possible */ /* inspect sense, determine specific ERP if possible */
if (erp != cqr) { if (erp != cqr) {
@ -2711,6 +2714,8 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr)
if (erp == NULL) { if (erp == NULL) {
/* no matching erp found - set up erp */ /* no matching erp found - set up erp */
erp = dasd_3990_erp_additional_erp(cqr); erp = dasd_3990_erp_additional_erp(cqr);
if (IS_ERR(erp))
return erp;
} else { } else {
/* matching erp found - set all leading erp's to DONE */ /* matching erp found - set all leading erp's to DONE */
erp = dasd_3990_erp_handle_match_erp(cqr, erp); erp = dasd_3990_erp_handle_match_erp(cqr, erp);