[patch 6/13] s390: dasd ioctl never returns.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Horst Hummel <[email protected]>

[patch 6/13] 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 <[email protected]>
Signed-off-by: Martin Schwidefsky <[email protected]>
---

 drivers/s390/block/dasd.c |    5 +++++
 1 files changed, 5 insertions(+)

diff -urpN linux-2.6/drivers/s390/block/dasd.c linux-2.6-patched/drivers/s390/block/dasd.c
--- linux-2.6/drivers/s390/block/dasd.c	2006-04-24 16:47:00.000000000 +0200
+++ linux-2.6-patched/drivers/s390/block/dasd.c	2006-04-24 16:47:23.000000000 +0200
@@ -315,6 +315,11 @@ dasd_increase_state(struct dasd_device *
 		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)
 		rc = dasd_state_ready_to_online(device);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux