]> git.itanic.dy.fi Git - linux-stable/commitdiff
s390/dasd: fix hanging offline processing due to canceled worker
authorStefan Haberland <sth@linux.ibm.com>
Wed, 25 Jul 2018 12:00:47 +0000 (14:00 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Thu, 9 Aug 2018 10:49:32 +0000 (12:49 +0200)
During offline processing two worker threads are canceled without
freeing the device reference which leads to a hanging offline process.

Reviewed-by: Jan Hoeppner <hoeppner@linux.ibm.com>
Signed-off-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
drivers/s390/block/dasd_eckd.c

index 1e97378d4f6069bfcf1d149e0c53ac601c93e93d..4e7b55a14b1a46d40920fde48460fa2400c46f84 100644 (file)
@@ -2038,8 +2038,11 @@ static int dasd_eckd_basic_to_ready(struct dasd_device *device)
 
 static int dasd_eckd_online_to_ready(struct dasd_device *device)
 {
-       cancel_work_sync(&device->reload_device);
-       cancel_work_sync(&device->kick_validate);
+       if (cancel_work_sync(&device->reload_device))
+               dasd_put_device(device);
+       if (cancel_work_sync(&device->kick_validate))
+               dasd_put_device(device);
+
        return 0;
 };