s390/dasd: fix infinite term I/O loop
authorStefan Haberland <stefan.haberland@de.ibm.com>
Mon, 24 Nov 2014 09:53:19 +0000 (10:53 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 28 Nov 2014 08:47:29 +0000 (09:47 +0100)
During device activation all paths could be lost and since the device
is not active it has no indication of this fact - hence the CQR will
time-out. The following cancelation might fail with -EINVAL because
CIO took over control and started path verification. In this case mark
the CQR as being CLEARED since it could not be running any more.

Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dasd.c

index 3679aeca1c1a02b4eed28a84ad9b7bab216c9f1f..8cb120e9c8681a9ca4d91b67fc021b24984339d4 100644 (file)
@@ -1377,6 +1377,20 @@ int dasd_term_IO(struct dasd_ccw_req *cqr)
                                      "I/O error, retry");
                        break;
                case -EINVAL:
+                       /*
+                        * device not valid so no I/O could be running
+                        * handle CQR as termination successful
+                        */
+                       cqr->status = DASD_CQR_CLEARED;
+                       cqr->stopclk = get_tod_clock();
+                       cqr->starttime = 0;
+                       /* no retries for invalid devices */
+                       cqr->retries = -1;
+                       DBF_DEV_EVENT(DBF_ERR, device, "%s",
+                                     "EINVAL, handle as terminated");
+                       /* fake rc to success */
+                       rc = 0;
+                       break;
                case -EBUSY:
                        DBF_DEV_EVENT(DBF_ERR, device, "%s",
                                      "device busy, retry later");