提交 39ccf95e 编写于 作者: H Horst Hummel 提交者: 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: NHorst Hummel <horst.hummel@de.ibm.com>
Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册