]> git.karo-electronics.de Git - linux-beck.git/commitdiff
s390/dasd: fix failing path verification
authorStefan Haberland <stefan.haberland@de.ibm.com>
Fri, 7 Aug 2015 11:19:03 +0000 (13:19 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Sun, 9 Aug 2015 19:07:41 +0000 (21:07 +0200)
DASD path verification requires the usage of sleep_on_immediatly to
ensure that no other I/O request is blocking the recovery of
disconnected devices. But two concurrent path verification workers for
the same device may kill each others requests due to the usage of the
immediate sleep_on function. This may lead to unsuccessful path
verifications.

Prevent that two parallel path verification workers conflict with
each other by implementing a device flag signalling a already running
worker.

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

index 6215f6455eb84ccc876e70156279681dce0e9bc3..d8144513fadc8679abc7c7dc86651f8d9b73e13e 100644 (file)
@@ -1259,7 +1259,11 @@ static void do_path_verification_work(struct work_struct *work)
                schedule_work(work);
                return;
        }
-
+       /* check if path verification already running and delay if so */
+       if (test_and_set_bit(DASD_FLAG_PATH_VERIFY, &device->flags)) {
+               schedule_work(work);
+               return;
+       }
        opm = 0;
        npm = 0;
        ppm = 0;
@@ -1402,7 +1406,7 @@ static void do_path_verification_work(struct work_struct *work)
                device->path_data.hpfpm |= hpfpm;
                spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
        }
-
+       clear_bit(DASD_FLAG_PATH_VERIFY, &device->flags);
        dasd_put_device(device);
        if (data->isglobal)
                mutex_unlock(&dasd_path_verification_mutex);
index 227e3dea3155268e7d060b07937bb7ac6d340732..4aed5ed708363b0a30be9c1b20201c478f5a7377 100644 (file)
@@ -534,6 +534,7 @@ struct dasd_attention_data {
 #define DASD_FLAG_SAFE_OFFLINE 10      /* safe offline processing requested*/
 #define DASD_FLAG_SAFE_OFFLINE_RUNNING 11      /* safe offline running */
 #define DASD_FLAG_ABORTALL     12      /* Abort all noretry requests */
+#define DASD_FLAG_PATH_VERIFY  13      /* Path verification worker running */
 
 #define DASD_SLEEPON_START_TAG ((void *) 1)
 #define DASD_SLEEPON_END_TAG   ((void *) 2)