Commit a7602f6c authored by Stefan Haberland's avatar Stefan Haberland Committed by Martin Schwidefsky

[S390] dasd: fix locking bug

Replace spin_lock with spin_lock_irqsave in dasd_eckd_restore_device.
Signed-off-by: default avatarStefan Haberland <stefan.haberland@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 03cadd36
...@@ -3216,6 +3216,7 @@ int dasd_eckd_restore_device(struct dasd_device *device) ...@@ -3216,6 +3216,7 @@ int dasd_eckd_restore_device(struct dasd_device *device)
struct dasd_eckd_characteristics temp_rdc_data; struct dasd_eckd_characteristics temp_rdc_data;
int is_known, rc; int is_known, rc;
struct dasd_uid temp_uid; struct dasd_uid temp_uid;
unsigned long flags;
private = (struct dasd_eckd_private *) device->private; private = (struct dasd_eckd_private *) device->private;
...@@ -3228,7 +3229,8 @@ int dasd_eckd_restore_device(struct dasd_device *device) ...@@ -3228,7 +3229,8 @@ int dasd_eckd_restore_device(struct dasd_device *device)
rc = dasd_eckd_generate_uid(device, &private->uid); rc = dasd_eckd_generate_uid(device, &private->uid);
dasd_get_uid(device->cdev, &temp_uid); dasd_get_uid(device->cdev, &temp_uid);
if (memcmp(&private->uid, &temp_uid, sizeof(struct dasd_uid)) != 0) if (memcmp(&private->uid, &temp_uid, sizeof(struct dasd_uid)) != 0)
dev_err(&device->cdev->dev, "The UID of the DASD has changed\n"); dev_err(&device->cdev->dev, "The UID of the DASD has "
"changed\n");
if (rc) if (rc)
goto out_err; goto out_err;
dasd_set_uid(device->cdev, &private->uid); dasd_set_uid(device->cdev, &private->uid);
...@@ -3256,9 +3258,9 @@ int dasd_eckd_restore_device(struct dasd_device *device) ...@@ -3256,9 +3258,9 @@ int dasd_eckd_restore_device(struct dasd_device *device)
"device: %s", rc, dev_name(&device->cdev->dev)); "device: %s", rc, dev_name(&device->cdev->dev));
goto out_err; goto out_err;
} }
spin_lock(get_ccwdev_lock(device->cdev)); spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
memcpy(&private->rdc_data, &temp_rdc_data, sizeof(temp_rdc_data)); memcpy(&private->rdc_data, &temp_rdc_data, sizeof(temp_rdc_data));
spin_unlock(get_ccwdev_lock(device->cdev)); spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
/* add device to alias management */ /* add device to alias management */
dasd_alias_add_device(device); dasd_alias_add_device(device);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment