diff options
author | Stefan Haberland <stefan.haberland@de.ibm.com> | 2012-03-11 11:59:37 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2012-03-11 11:59:29 -0400 |
commit | 25e2cf1c1ac52d5078cf8cc3fd2f2ad084669ddd (patch) | |
tree | 17cc628cb917ee6165bbbaa323c501d7653d7ffb /drivers/s390 | |
parent | 35424f636e9b6e79a362162aaac96b12cc8e8f69 (diff) |
[S390] dasd: prevent validate server for offline devices
Calling validate server on devices in offline processing may cause
an OOPS in the dasd_sleep_on function.
Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Reviewed-by: Stefan Weinhuber <wein@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/block/dasd.c | 4 | ||||
-rw-r--r-- | drivers/s390/block/dasd_eckd.c | 8 |
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 110137e7ec81..f3509120a507 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -640,6 +640,10 @@ void dasd_enable_device(struct dasd_device *device) | |||
640 | dasd_set_target_state(device, DASD_STATE_NEW); | 640 | dasd_set_target_state(device, DASD_STATE_NEW); |
641 | /* Now wait for the devices to come up. */ | 641 | /* Now wait for the devices to come up. */ |
642 | wait_event(dasd_init_waitq, _wait_for_device(device)); | 642 | wait_event(dasd_init_waitq, _wait_for_device(device)); |
643 | |||
644 | dasd_reload_device(device); | ||
645 | if (device->discipline->kick_validate) | ||
646 | device->discipline->kick_validate(device); | ||
643 | } | 647 | } |
644 | 648 | ||
645 | /* | 649 | /* |
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 2617b1ed4709..c21871a4e73d 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
@@ -1564,6 +1564,12 @@ static void dasd_eckd_do_validate_server(struct work_struct *work) | |||
1564 | static void dasd_eckd_kick_validate_server(struct dasd_device *device) | 1564 | static void dasd_eckd_kick_validate_server(struct dasd_device *device) |
1565 | { | 1565 | { |
1566 | dasd_get_device(device); | 1566 | dasd_get_device(device); |
1567 | /* exit if device not online or in offline processing */ | ||
1568 | if (test_bit(DASD_FLAG_OFFLINE, &device->flags) || | ||
1569 | device->state < DASD_STATE_ONLINE) { | ||
1570 | dasd_put_device(device); | ||
1571 | return; | ||
1572 | } | ||
1567 | /* queue call to do_validate_server to the kernel event daemon. */ | 1573 | /* queue call to do_validate_server to the kernel event daemon. */ |
1568 | schedule_work(&device->kick_validate); | 1574 | schedule_work(&device->kick_validate); |
1569 | } | 1575 | } |
@@ -1993,6 +1999,7 @@ static int dasd_eckd_ready_to_online(struct dasd_device *device) | |||
1993 | static int dasd_eckd_online_to_ready(struct dasd_device *device) | 1999 | static int dasd_eckd_online_to_ready(struct dasd_device *device) |
1994 | { | 2000 | { |
1995 | cancel_work_sync(&device->reload_device); | 2001 | cancel_work_sync(&device->reload_device); |
2002 | cancel_work_sync(&device->kick_validate); | ||
1996 | return dasd_alias_remove_device(device); | 2003 | return dasd_alias_remove_device(device); |
1997 | }; | 2004 | }; |
1998 | 2005 | ||
@@ -2263,6 +2270,7 @@ static void dasd_eckd_check_for_device_change(struct dasd_device *device, | |||
2263 | * and only if not suspended | 2270 | * and only if not suspended |
2264 | */ | 2271 | */ |
2265 | if (!device->block && private->lcu && | 2272 | if (!device->block && private->lcu && |
2273 | device->state == DASD_STATE_ONLINE && | ||
2266 | !test_bit(DASD_FLAG_OFFLINE, &device->flags) && | 2274 | !test_bit(DASD_FLAG_OFFLINE, &device->flags) && |
2267 | !test_bit(DASD_FLAG_SUSPENDED, &device->flags)) { | 2275 | !test_bit(DASD_FLAG_SUSPENDED, &device->flags)) { |
2268 | /* | 2276 | /* |