Commit 39ccf95e28765a08a9e01be614695d7c570b4e77
Committed by
Linus Torvalds
1 parent
a3ae39c060
Exists in
master
and in
4 other branches
[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>
Showing 1 changed file with 5 additions and 0 deletions Side-by-side Diff
drivers/s390/block/dasd.c
... | ... | @@ -315,6 +315,11 @@ |
315 | 315 | rc = dasd_state_basic_to_ready(device); |
316 | 316 | |
317 | 317 | if (!rc && |
318 | + device->state == DASD_STATE_UNFMT && | |
319 | + device->target > DASD_STATE_UNFMT) | |
320 | + rc = -EPERM; | |
321 | + | |
322 | + if (!rc && | |
318 | 323 | device->state == DASD_STATE_READY && |
319 | 324 | device->target >= DASD_STATE_ONLINE) |
320 | 325 | rc = dasd_state_ready_to_online(device); |