[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: Horst Hummel <horst.hummel@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
Horst Hummel 2006-04-27 18:40:10 -07:00 committed by Linus Torvalds
parent a3ae39c060
commit 39ccf95e28

View File

@ -314,6 +314,11 @@ dasd_increase_state(struct dasd_device *device)
device->target >= DASD_STATE_READY)
rc = dasd_state_basic_to_ready(device);
if (!rc &&
device->state == DASD_STATE_UNFMT &&
device->target > DASD_STATE_UNFMT)
rc = -EPERM;
if (!rc &&
device->state == DASD_STATE_READY &&
device->target >= DASD_STATE_ONLINE)