diff options
author | Stefan Haberland <stefan.haberland@de.ibm.com> | 2010-04-22 11:17:02 -0400 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2010-04-22 11:17:19 -0400 |
commit | 6a5176c474e3e722ab273d940442238e554e5e58 (patch) | |
tree | 0a623a707647b4511e99822fee37a7e2139689e4 | |
parent | 1ef6ce7a340f9ed139a73147ff9cf7ad56889414 (diff) |
[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>
-rw-r--r-- | drivers/s390/block/dasd.c | 3 | ||||
-rw-r--r-- | drivers/s390/block/dasd_3990_erp.c | 7 |
2 files changed, 8 insertions, 2 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index bbea90baf98f..acf222f91f5a 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -1899,7 +1899,8 @@ restart: | |||
1899 | /* Process requests that may be recovered */ | 1899 | /* Process requests that may be recovered */ |
1900 | if (cqr->status == DASD_CQR_NEED_ERP) { | 1900 | if (cqr->status == DASD_CQR_NEED_ERP) { |
1901 | erp_fn = base->discipline->erp_action(cqr); | 1901 | erp_fn = base->discipline->erp_action(cqr); |
1902 | erp_fn(cqr); | 1902 | if (IS_ERR(erp_fn(cqr))) |
1903 | continue; | ||
1903 | goto restart; | 1904 | goto restart; |
1904 | } | 1905 | } |
1905 | 1906 | ||
diff --git a/drivers/s390/block/dasd_3990_erp.c b/drivers/s390/block/dasd_3990_erp.c index 6927e751ce3e..6632649dd6aa 100644 --- a/drivers/s390/block/dasd_3990_erp.c +++ b/drivers/s390/block/dasd_3990_erp.c | |||
@@ -2309,7 +2309,7 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr) | |||
2309 | cqr->retries); | 2309 | cqr->retries); |
2310 | dasd_block_set_timer(device->block, (HZ << 3)); | 2310 | dasd_block_set_timer(device->block, (HZ << 3)); |
2311 | } | 2311 | } |
2312 | return cqr; | 2312 | return erp; |
2313 | } | 2313 | } |
2314 | 2314 | ||
2315 | ccw = cqr->cpaddr; | 2315 | ccw = cqr->cpaddr; |
@@ -2372,6 +2372,9 @@ dasd_3990_erp_additional_erp(struct dasd_ccw_req * cqr) | |||
2372 | /* add erp and initialize with default TIC */ | 2372 | /* add erp and initialize with default TIC */ |
2373 | erp = dasd_3990_erp_add_erp(cqr); | 2373 | erp = dasd_3990_erp_add_erp(cqr); |
2374 | 2374 | ||
2375 | if (IS_ERR(erp)) | ||
2376 | return erp; | ||
2377 | |||
2375 | /* inspect sense, determine specific ERP if possible */ | 2378 | /* inspect sense, determine specific ERP if possible */ |
2376 | if (erp != cqr) { | 2379 | if (erp != cqr) { |
2377 | 2380 | ||
@@ -2711,6 +2714,8 @@ dasd_3990_erp_action(struct dasd_ccw_req * cqr) | |||
2711 | if (erp == NULL) { | 2714 | if (erp == NULL) { |
2712 | /* no matching erp found - set up erp */ | 2715 | /* no matching erp found - set up erp */ |
2713 | erp = dasd_3990_erp_additional_erp(cqr); | 2716 | erp = dasd_3990_erp_additional_erp(cqr); |
2717 | if (IS_ERR(erp)) | ||
2718 | return erp; | ||
2714 | } else { | 2719 | } else { |
2715 | /* matching erp found - set all leading erp's to DONE */ | 2720 | /* matching erp found - set all leading erp's to DONE */ |
2716 | erp = dasd_3990_erp_handle_match_erp(cqr, erp); | 2721 | erp = dasd_3990_erp_handle_match_erp(cqr, erp); |