From 8fa56aed12f1b0a2828da52280e2efbbf1163ad5 Mon Sep 17 00:00:00 2001 From: Stefan Haberland Date: Fri, 18 Jul 2014 14:24:20 +0200 Subject: [PATCH] dasd: fix list_del corruption during format If I/O errors occur during format a kernel panic with a list_del corruption may occur. Stop error recovery procedure after an erp action was taken. Signed-off-by: Stefan Haberland Signed-off-by: Martin Schwidefsky --- drivers/s390/block/dasd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 9242d7cff9b5..925b056dc2b3 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -2307,8 +2307,12 @@ retry: rc = 0; list_for_each_entry_safe(cqr, n, ccw_queue, blocklist) { - if (__dasd_sleep_on_erp(cqr)) + if (__dasd_sleep_on_erp(cqr)) { + if (!cqr->status == DASD_CQR_TERMINATED && + !cqr->status == DASD_CQR_NEED_ERP) + break; rc = 1; + } } if (rc) goto retry; -- 2.39.5