diff options
author | Stefan Haberland <stefan.haberland@de.ibm.com> | 2015-04-02 12:27:25 +0200 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2015-04-15 12:23:50 +0200 |
commit | f2608cd4a37479d11d0748f524a6a363ee38631f (patch) | |
tree | f21edcbfd05db92f54dea89f32e43c6e2e1dcdd0 /drivers/s390/block/dasd.c | |
parent | 8741ce6d114873e482b1ef298d6537d18ff393d3 (diff) | |
download | op-kernel-dev-f2608cd4a37479d11d0748f524a6a363ee38631f.zip op-kernel-dev-f2608cd4a37479d11d0748f524a6a363ee38631f.tar.gz |
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: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/block/dasd.c')
-rw-r--r-- | drivers/s390/block/dasd.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 26a51dc..cd57857 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -579,7 +579,8 @@ void dasd_kick_device(struct dasd_device *device) { dasd_get_device(device); /* 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); @@ -599,7 +600,8 @@ void dasd_reload_device(struct dasd_device *device) { dasd_get_device(device); /* 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); @@ -619,7 +621,8 @@ void dasd_restore_device(struct dasd_device *device) { dasd_get_device(device); /* 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); } /* |