Commit 39ccf95e authored by Horst Hummel's avatar Horst Hummel Committed by Linus Torvalds

[PATCH] s390: dasd ioctl never returns

The dasd state machine is not designed to enable an unformatted device, since
'unformatted' is a final state.  The BIODASDENABLE ioctl calls
dasd_enable_device() which never returns if the device is in this special
state.  Return -EPERM in dasd_increase_state for unformatted devices to make
dasd_enable_device terminate.  Note: To get such an unformatted device online
it has to be re-analyzed.  This means that the device needs to be disabled
prior to re-enablement.
Signed-off-by: default avatarHorst Hummel <horst.hummel@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent a3ae39c0
...@@ -314,6 +314,11 @@ dasd_increase_state(struct dasd_device *device) ...@@ -314,6 +314,11 @@ dasd_increase_state(struct dasd_device *device)
device->target >= DASD_STATE_READY) device->target >= DASD_STATE_READY)
rc = dasd_state_basic_to_ready(device); rc = dasd_state_basic_to_ready(device);
if (!rc &&
device->state == DASD_STATE_UNFMT &&
device->target > DASD_STATE_UNFMT)
rc = -EPERM;
if (!rc && if (!rc &&
device->state == DASD_STATE_READY && device->state == DASD_STATE_READY &&
device->target >= DASD_STATE_ONLINE) device->target >= DASD_STATE_ONLINE)
......
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