diff options
Diffstat (limited to 'drivers/s390/block/dasd.c')
-rw-r--r-- | drivers/s390/block/dasd.c | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 0a9f12c4e911..a3bfebcf31ef 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -1257,25 +1257,28 @@ __dasd_start_head(struct dasd_device * device) | |||
1257 | if (list_empty(&device->ccw_queue)) | 1257 | if (list_empty(&device->ccw_queue)) |
1258 | return; | 1258 | return; |
1259 | cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list); | 1259 | cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list); |
1260 | /* check FAILFAST */ | 1260 | if (cqr->status != DASD_CQR_QUEUED) |
1261 | return; | ||
1262 | /* Non-temporary stop condition will trigger fail fast */ | ||
1261 | if (device->stopped & ~DASD_STOPPED_PENDING && | 1263 | if (device->stopped & ~DASD_STOPPED_PENDING && |
1262 | test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) && | 1264 | test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) && |
1263 | (!dasd_eer_enabled(device))) { | 1265 | (!dasd_eer_enabled(device))) { |
1264 | cqr->status = DASD_CQR_FAILED; | 1266 | cqr->status = DASD_CQR_FAILED; |
1265 | dasd_schedule_bh(device); | 1267 | dasd_schedule_bh(device); |
1268 | return; | ||
1266 | } | 1269 | } |
1267 | if ((cqr->status == DASD_CQR_QUEUED) && | 1270 | /* Don't try to start requests if device is stopped */ |
1268 | (!device->stopped)) { | 1271 | if (device->stopped) |
1269 | /* try to start the first I/O that can be started */ | 1272 | return; |
1270 | rc = device->discipline->start_IO(cqr); | 1273 | |
1271 | if (rc == 0) | 1274 | rc = device->discipline->start_IO(cqr); |
1272 | dasd_set_timer(device, cqr->expires); | 1275 | if (rc == 0) |
1273 | else if (rc == -EACCES) { | 1276 | dasd_set_timer(device, cqr->expires); |
1274 | dasd_schedule_bh(device); | 1277 | else if (rc == -EACCES) { |
1275 | } else | 1278 | dasd_schedule_bh(device); |
1276 | /* Hmpf, try again in 1/2 sec */ | 1279 | } else |
1277 | dasd_set_timer(device, 50); | 1280 | /* Hmpf, try again in 1/2 sec */ |
1278 | } | 1281 | dasd_set_timer(device, 50); |
1279 | } | 1282 | } |
1280 | 1283 | ||
1281 | /* | 1284 | /* |
@@ -1968,7 +1971,7 @@ int | |||
1968 | dasd_generic_set_offline (struct ccw_device *cdev) | 1971 | dasd_generic_set_offline (struct ccw_device *cdev) |
1969 | { | 1972 | { |
1970 | struct dasd_device *device; | 1973 | struct dasd_device *device; |
1971 | int max_count; | 1974 | int max_count, open_count; |
1972 | 1975 | ||
1973 | device = dasd_device_from_cdev(cdev); | 1976 | device = dasd_device_from_cdev(cdev); |
1974 | if (IS_ERR(device)) | 1977 | if (IS_ERR(device)) |
@@ -1985,10 +1988,16 @@ dasd_generic_set_offline (struct ccw_device *cdev) | |||
1985 | * in the other openers. | 1988 | * in the other openers. |
1986 | */ | 1989 | */ |
1987 | max_count = device->bdev ? 0 : -1; | 1990 | max_count = device->bdev ? 0 : -1; |
1988 | if (atomic_read(&device->open_count) > max_count) { | 1991 | open_count = (int) atomic_read(&device->open_count); |
1989 | printk (KERN_WARNING "Can't offline dasd device with open" | 1992 | if (open_count > max_count) { |
1990 | " count = %i.\n", | 1993 | if (open_count > 0) |
1991 | atomic_read(&device->open_count)); | 1994 | printk (KERN_WARNING "Can't offline dasd device with " |
1995 | "open count = %i.\n", | ||
1996 | open_count); | ||
1997 | else | ||
1998 | printk (KERN_WARNING "%s", | ||
1999 | "Can't offline dasd device due to internal " | ||
2000 | "use\n"); | ||
1992 | clear_bit(DASD_FLAG_OFFLINE, &device->flags); | 2001 | clear_bit(DASD_FLAG_OFFLINE, &device->flags); |
1993 | dasd_put_device(device); | 2002 | dasd_put_device(device); |
1994 | return -EBUSY; | 2003 | return -EBUSY; |