aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Haberland <stefan.haberland@de.ibm.com>2015-04-02 06:27:25 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2015-04-15 06:23:50 -0400
commitf2608cd4a37479d11d0748f524a6a363ee38631f (patch)
treef21edcbfd05db92f54dea89f32e43c6e2e1dcdd0
parent8741ce6d114873e482b1ef298d6537d18ff393d3 (diff)
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>
-rw-r--r--drivers/s390/block/dasd.c9
-rw-r--r--drivers/s390/block/dasd_eckd.c3
2 files changed, 8 insertions, 4 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 26a51dc4278d..cd57857a1c84 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)
579{ 579{
580 dasd_get_device(device); 580 dasd_get_device(device);
581 /* queue call to dasd_kick_device to the kernel event daemon. */ 581 /* queue call to dasd_kick_device to the kernel event daemon. */
582 schedule_work(&device->kick_work); 582 if (!schedule_work(&device->kick_work))
583 dasd_put_device(device);
583} 584}
584EXPORT_SYMBOL(dasd_kick_device); 585EXPORT_SYMBOL(dasd_kick_device);
585 586
@@ -599,7 +600,8 @@ void dasd_reload_device(struct dasd_device *device)
599{ 600{
600 dasd_get_device(device); 601 dasd_get_device(device);
601 /* queue call to dasd_reload_device to the kernel event daemon. */ 602 /* queue call to dasd_reload_device to the kernel event daemon. */
602 schedule_work(&device->reload_device); 603 if (!schedule_work(&device->reload_device))
604 dasd_put_device(device);
603} 605}
604EXPORT_SYMBOL(dasd_reload_device); 606EXPORT_SYMBOL(dasd_reload_device);
605 607
@@ -619,7 +621,8 @@ void dasd_restore_device(struct dasd_device *device)
619{ 621{
620 dasd_get_device(device); 622 dasd_get_device(device);
621 /* queue call to dasd_restore_device to the kernel event daemon. */ 623 /* queue call to dasd_restore_device to the kernel event daemon. */
622 schedule_work(&device->restore_device); 624 if (!schedule_work(&device->restore_device))
625 dasd_put_device(device);
623} 626}
624 627
625/* 628/*
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 49b48a887c66..6215f6455eb8 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -1628,7 +1628,8 @@ static void dasd_eckd_kick_validate_server(struct dasd_device *device)
1628 return; 1628 return;
1629 } 1629 }
1630 /* queue call to do_validate_server to the kernel event daemon. */ 1630 /* queue call to do_validate_server to the kernel event daemon. */
1631 schedule_work(&device->kick_validate); 1631 if (!schedule_work(&device->kick_validate))
1632 dasd_put_device(device);
1632} 1633}
1633 1634
1634static u32 get_fcx_max_data(struct dasd_device *device) 1635static u32 get_fcx_max_data(struct dasd_device *device)