diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2009-03-31 13:16:06 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-03-31 13:17:06 -0400 |
commit | b5cd99e6b002776c0e946f38292adbb0258b7983 (patch) | |
tree | 5ab63d9d5ee4e325b6221107873b1c32573682b0 /drivers | |
parent | 47593bfa1056d306fde067b28dd8617009be4121 (diff) |
[S390] cio: disallow online setting of device in transient state
Return -EAGAIN on writes to sysfs online attribute if the corresponding
ccw device is in transient state.
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/s390/cio/device.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 868f8c6b053a..e47aa3f04769 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -515,7 +515,11 @@ static ssize_t online_store (struct device *dev, struct device_attribute *attr, | |||
515 | int force, ret; | 515 | int force, ret; |
516 | unsigned long i; | 516 | unsigned long i; |
517 | 517 | ||
518 | if (atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0) | 518 | if ((cdev->private->state != DEV_STATE_OFFLINE && |
519 | cdev->private->state != DEV_STATE_ONLINE && | ||
520 | cdev->private->state != DEV_STATE_BOXED && | ||
521 | cdev->private->state != DEV_STATE_DISCONNECTED) || | ||
522 | atomic_cmpxchg(&cdev->private->onoff, 0, 1) != 0) | ||
519 | return -EAGAIN; | 523 | return -EAGAIN; |
520 | 524 | ||
521 | if (cdev->drv && !try_module_get(cdev->drv->owner)) { | 525 | if (cdev->drv && !try_module_get(cdev->drv->owner)) { |