Commit 25e2cf1c authored by Stefan Haberland's avatar Stefan Haberland Committed by Martin Schwidefsky

[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: default avatarStefan Haberland <stefan.haberland@de.ibm.com>
Reviewed-by: default avatarStefan Weinhuber <wein@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 35424f63
...@@ -640,6 +640,10 @@ void dasd_enable_device(struct dasd_device *device) ...@@ -640,6 +640,10 @@ void dasd_enable_device(struct dasd_device *device)
dasd_set_target_state(device, DASD_STATE_NEW); dasd_set_target_state(device, DASD_STATE_NEW);
/* Now wait for the devices to come up. */ /* Now wait for the devices to come up. */
wait_event(dasd_init_waitq, _wait_for_device(device)); wait_event(dasd_init_waitq, _wait_for_device(device));
dasd_reload_device(device);
if (device->discipline->kick_validate)
device->discipline->kick_validate(device);
} }
/* /*
......
...@@ -1564,6 +1564,12 @@ static void dasd_eckd_do_validate_server(struct work_struct *work) ...@@ -1564,6 +1564,12 @@ static void dasd_eckd_do_validate_server(struct work_struct *work)
static void dasd_eckd_kick_validate_server(struct dasd_device *device) static void dasd_eckd_kick_validate_server(struct dasd_device *device)
{ {
dasd_get_device(device); dasd_get_device(device);
/* exit if device not online or in offline processing */
if (test_bit(DASD_FLAG_OFFLINE, &device->flags) ||
device->state < DASD_STATE_ONLINE) {
dasd_put_device(device);
return;
}
/* queue call to do_validate_server to the kernel event daemon. */ /* queue call to do_validate_server to the kernel event daemon. */
schedule_work(&device->kick_validate); schedule_work(&device->kick_validate);
} }
...@@ -1993,6 +1999,7 @@ static int dasd_eckd_ready_to_online(struct dasd_device *device) ...@@ -1993,6 +1999,7 @@ static int dasd_eckd_ready_to_online(struct dasd_device *device)
static int dasd_eckd_online_to_ready(struct dasd_device *device) static int dasd_eckd_online_to_ready(struct dasd_device *device)
{ {
cancel_work_sync(&device->reload_device); cancel_work_sync(&device->reload_device);
cancel_work_sync(&device->kick_validate);
return dasd_alias_remove_device(device); return dasd_alias_remove_device(device);
}; };
...@@ -2263,6 +2270,7 @@ static void dasd_eckd_check_for_device_change(struct dasd_device *device, ...@@ -2263,6 +2270,7 @@ static void dasd_eckd_check_for_device_change(struct dasd_device *device,
* and only if not suspended * and only if not suspended
*/ */
if (!device->block && private->lcu && if (!device->block && private->lcu &&
device->state == DASD_STATE_ONLINE &&
!test_bit(DASD_FLAG_OFFLINE, &device->flags) && !test_bit(DASD_FLAG_OFFLINE, &device->flags) &&
!test_bit(DASD_FLAG_SUSPENDED, &device->flags)) { !test_bit(DASD_FLAG_SUSPENDED, &device->flags)) {
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment