diff options
author | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-04-29 01:11:23 -0400 |
---|---|---|
committer | Dmitry Torokhov <dtor_core@ameritech.net> | 2006-04-29 01:11:23 -0400 |
commit | 7b7e394185014e0f3bd8989cac937003f20ef9ce (patch) | |
tree | 3beda5f979bba0aa9822534e239cf1b45f3be69c /drivers/s390/block/dasd.c | |
parent | ddc5d3414593e4d7ad7fbd33e7f7517fcc234544 (diff) | |
parent | 693f7d362055261882659475d2ef022e32edbff1 (diff) |
Merge rsync://rsync.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'drivers/s390/block/dasd.c')
-rw-r--r-- | drivers/s390/block/dasd.c | 50 |
1 files changed, 32 insertions, 18 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 0a9f12c4e911..cfb1fff3787c 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -315,6 +315,11 @@ dasd_increase_state(struct dasd_device *device) | |||
315 | rc = dasd_state_basic_to_ready(device); | 315 | rc = dasd_state_basic_to_ready(device); |
316 | 316 | ||
317 | if (!rc && | 317 | if (!rc && |
318 | device->state == DASD_STATE_UNFMT && | ||
319 | device->target > DASD_STATE_UNFMT) | ||
320 | rc = -EPERM; | ||
321 | |||
322 | if (!rc && | ||
318 | device->state == DASD_STATE_READY && | 323 | device->state == DASD_STATE_READY && |
319 | device->target >= DASD_STATE_ONLINE) | 324 | device->target >= DASD_STATE_ONLINE) |
320 | rc = dasd_state_ready_to_online(device); | 325 | rc = dasd_state_ready_to_online(device); |
@@ -1257,25 +1262,28 @@ __dasd_start_head(struct dasd_device * device) | |||
1257 | if (list_empty(&device->ccw_queue)) | 1262 | if (list_empty(&device->ccw_queue)) |
1258 | return; | 1263 | return; |
1259 | cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list); | 1264 | cqr = list_entry(device->ccw_queue.next, struct dasd_ccw_req, list); |
1260 | /* check FAILFAST */ | 1265 | if (cqr->status != DASD_CQR_QUEUED) |
1266 | return; | ||
1267 | /* Non-temporary stop condition will trigger fail fast */ | ||
1261 | if (device->stopped & ~DASD_STOPPED_PENDING && | 1268 | if (device->stopped & ~DASD_STOPPED_PENDING && |
1262 | test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) && | 1269 | test_bit(DASD_CQR_FLAGS_FAILFAST, &cqr->flags) && |
1263 | (!dasd_eer_enabled(device))) { | 1270 | (!dasd_eer_enabled(device))) { |
1264 | cqr->status = DASD_CQR_FAILED; | 1271 | cqr->status = DASD_CQR_FAILED; |
1265 | dasd_schedule_bh(device); | 1272 | dasd_schedule_bh(device); |
1273 | return; | ||
1266 | } | 1274 | } |
1267 | if ((cqr->status == DASD_CQR_QUEUED) && | 1275 | /* Don't try to start requests if device is stopped */ |
1268 | (!device->stopped)) { | 1276 | if (device->stopped) |
1269 | /* try to start the first I/O that can be started */ | 1277 | return; |
1270 | rc = device->discipline->start_IO(cqr); | 1278 | |
1271 | if (rc == 0) | 1279 | rc = device->discipline->start_IO(cqr); |
1272 | dasd_set_timer(device, cqr->expires); | 1280 | if (rc == 0) |
1273 | else if (rc == -EACCES) { | 1281 | dasd_set_timer(device, cqr->expires); |
1274 | dasd_schedule_bh(device); | 1282 | else if (rc == -EACCES) { |
1275 | } else | 1283 | dasd_schedule_bh(device); |
1276 | /* Hmpf, try again in 1/2 sec */ | 1284 | } else |
1277 | dasd_set_timer(device, 50); | 1285 | /* Hmpf, try again in 1/2 sec */ |
1278 | } | 1286 | dasd_set_timer(device, 50); |
1279 | } | 1287 | } |
1280 | 1288 | ||
1281 | /* | 1289 | /* |
@@ -1968,7 +1976,7 @@ int | |||
1968 | dasd_generic_set_offline (struct ccw_device *cdev) | 1976 | dasd_generic_set_offline (struct ccw_device *cdev) |
1969 | { | 1977 | { |
1970 | struct dasd_device *device; | 1978 | struct dasd_device *device; |
1971 | int max_count; | 1979 | int max_count, open_count; |
1972 | 1980 | ||
1973 | device = dasd_device_from_cdev(cdev); | 1981 | device = dasd_device_from_cdev(cdev); |
1974 | if (IS_ERR(device)) | 1982 | if (IS_ERR(device)) |
@@ -1985,10 +1993,16 @@ dasd_generic_set_offline (struct ccw_device *cdev) | |||
1985 | * in the other openers. | 1993 | * in the other openers. |
1986 | */ | 1994 | */ |
1987 | max_count = device->bdev ? 0 : -1; | 1995 | max_count = device->bdev ? 0 : -1; |
1988 | if (atomic_read(&device->open_count) > max_count) { | 1996 | open_count = (int) atomic_read(&device->open_count); |
1989 | printk (KERN_WARNING "Can't offline dasd device with open" | 1997 | if (open_count > max_count) { |
1990 | " count = %i.\n", | 1998 | if (open_count > 0) |
1991 | atomic_read(&device->open_count)); | 1999 | printk (KERN_WARNING "Can't offline dasd device with " |
2000 | "open count = %i.\n", | ||
2001 | open_count); | ||
2002 | else | ||
2003 | printk (KERN_WARNING "%s", | ||
2004 | "Can't offline dasd device due to internal " | ||
2005 | "use\n"); | ||
1992 | clear_bit(DASD_FLAG_OFFLINE, &device->flags); | 2006 | clear_bit(DASD_FLAG_OFFLINE, &device->flags); |
1993 | dasd_put_device(device); | 2007 | dasd_put_device(device); |
1994 | return -EBUSY; | 2008 | return -EBUSY; |