diff options
Diffstat (limited to 'drivers/s390/block/dasd.c')
-rw-r--r-- | drivers/s390/block/dasd.c | 42 |
1 files changed, 27 insertions, 15 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 26a51dc4278d..57fd66357b95 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); } /* @@ -2163,18 +2166,22 @@ static int _dasd_sleep_on(struct dasd_ccw_req *maincqr, int interruptible) cqr->intrc = -ENOLINK; continue; } - /* Don't try to start requests if device is stopped */ - if (interruptible) { - rc = wait_event_interruptible( - generic_waitq, !(device->stopped)); - if (rc == -ERESTARTSYS) { - cqr->status = DASD_CQR_FAILED; - maincqr->intrc = rc; - continue; - } - } else - wait_event(generic_waitq, !(device->stopped)); - + /* + * Don't try to start requests if device is stopped + * except path verification requests + */ + if (!test_bit(DASD_CQR_VERIFY_PATH, &cqr->flags)) { + if (interruptible) { + rc = wait_event_interruptible( + generic_waitq, !(device->stopped)); + if (rc == -ERESTARTSYS) { + cqr->status = DASD_CQR_FAILED; + maincqr->intrc = rc; + continue; + } + } else + wait_event(generic_waitq, !(device->stopped)); + } if (!cqr->callback) cqr->callback = dasd_wakeup_cb; @@ -2524,6 +2531,11 @@ static void __dasd_process_request_queue(struct dasd_block *block) __blk_end_request_all(req, -EIO); return; } + + /* if device ist stopped do not fetch new requests */ + if (basedev->stopped) + return; + /* Now we try to fetch requests from the request queue */ while ((req = blk_peek_request(queue))) { if (basedev->features & DASD_FEATURE_READONLY && |