diff options
author | Stefan Haberland <stefan.haberland@de.ibm.com> | 2011-01-31 05:30:03 -0500 |
---|---|---|
committer | Martin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com> | 2011-01-31 05:30:20 -0500 |
commit | f602f6d694a99a0141c066c8f0b360a0b3c16915 (patch) | |
tree | cde04e5bf11edeeb54e32153a90ec024a76c921a /drivers/s390/block | |
parent | 70d1f365568e0cdbc9f4ab92428e1830fdb09ab0 (diff) |
[S390] dasd: prevent panic with unresumed devices
If a device is not resumed correctly the system crashes when this
device is set offline. This may happen if it gets disconnected
during suspend.
Check if the device is already removed from alias handling and skip
these steps to prevent the kernel panic.
Signed-off-by: Stefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/block')
-rw-r--r-- | drivers/s390/block/dasd_alias.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/s390/block/dasd_alias.c b/drivers/s390/block/dasd_alias.c index 4155805dcdff..2b771f18d1ad 100644 --- a/drivers/s390/block/dasd_alias.c +++ b/drivers/s390/block/dasd_alias.c | |||
@@ -319,6 +319,9 @@ void dasd_alias_disconnect_device_from_lcu(struct dasd_device *device) | |||
319 | 319 | ||
320 | private = (struct dasd_eckd_private *) device->private; | 320 | private = (struct dasd_eckd_private *) device->private; |
321 | lcu = private->lcu; | 321 | lcu = private->lcu; |
322 | /* nothing to do if already disconnected */ | ||
323 | if (!lcu) | ||
324 | return; | ||
322 | device->discipline->get_uid(device, &uid); | 325 | device->discipline->get_uid(device, &uid); |
323 | spin_lock_irqsave(&lcu->lock, flags); | 326 | spin_lock_irqsave(&lcu->lock, flags); |
324 | list_del_init(&device->alias_list); | 327 | list_del_init(&device->alias_list); |
@@ -680,6 +683,9 @@ int dasd_alias_remove_device(struct dasd_device *device) | |||
680 | 683 | ||
681 | private = (struct dasd_eckd_private *) device->private; | 684 | private = (struct dasd_eckd_private *) device->private; |
682 | lcu = private->lcu; | 685 | lcu = private->lcu; |
686 | /* nothing to do if already removed */ | ||
687 | if (!lcu) | ||
688 | return 0; | ||
683 | spin_lock_irqsave(&lcu->lock, flags); | 689 | spin_lock_irqsave(&lcu->lock, flags); |
684 | _remove_device_from_lcu(lcu, device); | 690 | _remove_device_from_lcu(lcu, device); |
685 | spin_unlock_irqrestore(&lcu->lock, flags); | 691 | spin_unlock_irqrestore(&lcu->lock, flags); |