Browse Source

s390/dasd: fix hanging offline processing due to canceled worker

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>
Stefan Haberland 7 năm trước cách đây
mục cha
commit
669f3765b7
1 tập tin đã thay đổi với 5 bổ sung2 xóa
  1. 5 2
      drivers/s390/block/dasd_eckd.c

+ 5 - 2
drivers/s390/block/dasd_eckd.c

@@ -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)
 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;
 	return 0;
 };
 };