Commit f2608cd4 authored by Stefan Haberland's avatar Stefan Haberland Committed by Martin Schwidefsky

s390/dasd: fix inability to set a DASD device offline

Fix ref counting for DASD devices leading to an inability to set a
DASD device offline.
Before a worker is scheduled the DASD device driver takes a reference
to the device. If the worker was already scheduled this reference was
never freed.
Fix by giving the reference to the DASD device free when
schedule_work() returns false.
Signed-off-by: default avatarStefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 8741ce6d
...@@ -579,7 +579,8 @@ void dasd_kick_device(struct dasd_device *device) ...@@ -579,7 +579,8 @@ void dasd_kick_device(struct dasd_device *device)
{ {
dasd_get_device(device); dasd_get_device(device);
/* queue call to dasd_kick_device to the kernel event daemon. */ /* queue call to dasd_kick_device to the kernel event daemon. */
schedule_work(&device->kick_work); if (!schedule_work(&device->kick_work))
dasd_put_device(device);
} }
EXPORT_SYMBOL(dasd_kick_device); EXPORT_SYMBOL(dasd_kick_device);
...@@ -599,7 +600,8 @@ void dasd_reload_device(struct dasd_device *device) ...@@ -599,7 +600,8 @@ void dasd_reload_device(struct dasd_device *device)
{ {
dasd_get_device(device); dasd_get_device(device);
/* queue call to dasd_reload_device to the kernel event daemon. */ /* queue call to dasd_reload_device to the kernel event daemon. */
schedule_work(&device->reload_device); if (!schedule_work(&device->reload_device))
dasd_put_device(device);
} }
EXPORT_SYMBOL(dasd_reload_device); EXPORT_SYMBOL(dasd_reload_device);
...@@ -619,7 +621,8 @@ void dasd_restore_device(struct dasd_device *device) ...@@ -619,7 +621,8 @@ void dasd_restore_device(struct dasd_device *device)
{ {
dasd_get_device(device); dasd_get_device(device);
/* queue call to dasd_restore_device to the kernel event daemon. */ /* queue call to dasd_restore_device to the kernel event daemon. */
schedule_work(&device->restore_device); if (!schedule_work(&device->restore_device))
dasd_put_device(device);
} }
/* /*
......
...@@ -1628,7 +1628,8 @@ static void dasd_eckd_kick_validate_server(struct dasd_device *device) ...@@ -1628,7 +1628,8 @@ static void dasd_eckd_kick_validate_server(struct dasd_device *device)
return; return;
} }
/* queue call to do_validate_server to the kernel event daemon. */ /* queue call to do_validate_server to the kernel event daemon. */
schedule_work(&device->kick_validate); if (!schedule_work(&device->kick_validate))
dasd_put_device(device);
} }
static u32 get_fcx_max_data(struct dasd_device *device) static u32 get_fcx_max_data(struct dasd_device *device)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment