diff options
Diffstat (limited to 'drivers/s390/block')
-rw-r--r-- | drivers/s390/block/dasd.c | 45 | ||||
-rw-r--r-- | drivers/s390/block/dasd_proc.c | 17 |
2 files changed, 44 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; |
diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c index 1aa3c261718a..ad23aede356c 100644 --- a/drivers/s390/block/dasd_proc.c +++ b/drivers/s390/block/dasd_proc.c | |||
@@ -294,23 +294,40 @@ out_error: | |||
294 | #endif /* CONFIG_DASD_PROFILE */ | 294 | #endif /* CONFIG_DASD_PROFILE */ |
295 | } | 295 | } |
296 | 296 | ||
297 | /* | ||
298 | * Create dasd proc-fs entries. | ||
299 | * In case creation failed, cleanup and return -ENOENT. | ||
300 | */ | ||
297 | int | 301 | int |
298 | dasd_proc_init(void) | 302 | dasd_proc_init(void) |
299 | { | 303 | { |
300 | dasd_proc_root_entry = proc_mkdir("dasd", &proc_root); | 304 | dasd_proc_root_entry = proc_mkdir("dasd", &proc_root); |
305 | if (!dasd_proc_root_entry) | ||
306 | goto out_nodasd; | ||
301 | dasd_proc_root_entry->owner = THIS_MODULE; | 307 | dasd_proc_root_entry->owner = THIS_MODULE; |
302 | dasd_devices_entry = create_proc_entry("devices", | 308 | dasd_devices_entry = create_proc_entry("devices", |
303 | S_IFREG | S_IRUGO | S_IWUSR, | 309 | S_IFREG | S_IRUGO | S_IWUSR, |
304 | dasd_proc_root_entry); | 310 | dasd_proc_root_entry); |
311 | if (!dasd_devices_entry) | ||
312 | goto out_nodevices; | ||
305 | dasd_devices_entry->proc_fops = &dasd_devices_file_ops; | 313 | dasd_devices_entry->proc_fops = &dasd_devices_file_ops; |
306 | dasd_devices_entry->owner = THIS_MODULE; | 314 | dasd_devices_entry->owner = THIS_MODULE; |
307 | dasd_statistics_entry = create_proc_entry("statistics", | 315 | dasd_statistics_entry = create_proc_entry("statistics", |
308 | S_IFREG | S_IRUGO | S_IWUSR, | 316 | S_IFREG | S_IRUGO | S_IWUSR, |
309 | dasd_proc_root_entry); | 317 | dasd_proc_root_entry); |
318 | if (!dasd_statistics_entry) | ||
319 | goto out_nostatistics; | ||
310 | dasd_statistics_entry->read_proc = dasd_statistics_read; | 320 | dasd_statistics_entry->read_proc = dasd_statistics_read; |
311 | dasd_statistics_entry->write_proc = dasd_statistics_write; | 321 | dasd_statistics_entry->write_proc = dasd_statistics_write; |
312 | dasd_statistics_entry->owner = THIS_MODULE; | 322 | dasd_statistics_entry->owner = THIS_MODULE; |
313 | return 0; | 323 | return 0; |
324 | |||
325 | out_nostatistics: | ||
326 | remove_proc_entry("devices", dasd_proc_root_entry); | ||
327 | out_nodevices: | ||
328 | remove_proc_entry("dasd", &proc_root); | ||
329 | out_nodasd: | ||
330 | return -ENOENT; | ||
314 | } | 331 | } |
315 | 332 | ||
316 | void | 333 | void |