Skip to content

Commit

Permalink
[PATCH] s390: dasd ioctl never returns
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Horst Hummel authored and Linus Torvalds committed Apr 28, 2006
1 parent a3ae39c commit 39ccf95
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 39ccf95

Please sign in to comment.