[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>
This commit is contained in:
parent
70d1f36556
commit
f602f6d694
|
@ -319,6 +319,9 @@ void dasd_alias_disconnect_device_from_lcu(struct dasd_device *device)
|
||||||
|
|
||||||
private = (struct dasd_eckd_private *) device->private;
|
private = (struct dasd_eckd_private *) device->private;
|
||||||
lcu = private->lcu;
|
lcu = private->lcu;
|
||||||
|
/* nothing to do if already disconnected */
|
||||||
|
if (!lcu)
|
||||||
|
return;
|
||||||
device->discipline->get_uid(device, &uid);
|
device->discipline->get_uid(device, &uid);
|
||||||
spin_lock_irqsave(&lcu->lock, flags);
|
spin_lock_irqsave(&lcu->lock, flags);
|
||||||
list_del_init(&device->alias_list);
|
list_del_init(&device->alias_list);
|
||||||
|
@ -680,6 +683,9 @@ int dasd_alias_remove_device(struct dasd_device *device)
|
||||||
|
|
||||||
private = (struct dasd_eckd_private *) device->private;
|
private = (struct dasd_eckd_private *) device->private;
|
||||||
lcu = private->lcu;
|
lcu = private->lcu;
|
||||||
|
/* nothing to do if already removed */
|
||||||
|
if (!lcu)
|
||||||
|
return 0;
|
||||||
spin_lock_irqsave(&lcu->lock, flags);
|
spin_lock_irqsave(&lcu->lock, flags);
|
||||||
_remove_device_from_lcu(lcu, device);
|
_remove_device_from_lcu(lcu, device);
|
||||||
spin_unlock_irqrestore(&lcu->lock, flags);
|
spin_unlock_irqrestore(&lcu->lock, flags);
|
||||||
|
|
Loading…
Reference in New Issue