aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block
diff options
context:
space:
mode:
authorStefan Haberland <stefan.haberland@de.ibm.com>2009-10-14 06:43:46 -0400
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2009-10-14 06:43:52 -0400
commita7602f6c16b2de2962b279980693ad1b3711e84a (patch)
treea58ecfd6bf49a2b64445ccda1f727f77bbdaa62d /drivers/s390/block
parent03cadd36d51c737d7ad6aa21e2524296be6fe57f (diff)
[S390] dasd: fix locking bug
Replace spin_lock with spin_lock_irqsave in dasd_eckd_restore_device. 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_eckd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
index 0be7c15f45c5..417b97cd3f94 100644
--- a/drivers/s390/block/dasd_eckd.c
+++ b/drivers/s390/block/dasd_eckd.c
@@ -3216,6 +3216,7 @@ int dasd_eckd_restore_device(struct dasd_device *device)
3216 struct dasd_eckd_characteristics temp_rdc_data; 3216 struct dasd_eckd_characteristics temp_rdc_data;
3217 int is_known, rc; 3217 int is_known, rc;
3218 struct dasd_uid temp_uid; 3218 struct dasd_uid temp_uid;
3219 unsigned long flags;
3219 3220
3220 private = (struct dasd_eckd_private *) device->private; 3221 private = (struct dasd_eckd_private *) device->private;
3221 3222
@@ -3228,7 +3229,8 @@ int dasd_eckd_restore_device(struct dasd_device *device)
3228 rc = dasd_eckd_generate_uid(device, &private->uid); 3229 rc = dasd_eckd_generate_uid(device, &private->uid);
3229 dasd_get_uid(device->cdev, &temp_uid); 3230 dasd_get_uid(device->cdev, &temp_uid);
3230 if (memcmp(&private->uid, &temp_uid, sizeof(struct dasd_uid)) != 0) 3231 if (memcmp(&private->uid, &temp_uid, sizeof(struct dasd_uid)) != 0)
3231 dev_err(&device->cdev->dev, "The UID of the DASD has changed\n"); 3232 dev_err(&device->cdev->dev, "The UID of the DASD has "
3233 "changed\n");
3232 if (rc) 3234 if (rc)
3233 goto out_err; 3235 goto out_err;
3234 dasd_set_uid(device->cdev, &private->uid); 3236 dasd_set_uid(device->cdev, &private->uid);
@@ -3256,9 +3258,9 @@ int dasd_eckd_restore_device(struct dasd_device *device)
3256 "device: %s", rc, dev_name(&device->cdev->dev)); 3258 "device: %s", rc, dev_name(&device->cdev->dev));
3257 goto out_err; 3259 goto out_err;
3258 } 3260 }
3259 spin_lock(get_ccwdev_lock(device->cdev)); 3261 spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
3260 memcpy(&private->rdc_data, &temp_rdc_data, sizeof(temp_rdc_data)); 3262 memcpy(&private->rdc_data, &temp_rdc_data, sizeof(temp_rdc_data));
3261 spin_unlock(get_ccwdev_lock(device->cdev)); 3263 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
3262 3264
3263 /* add device to alias management */ 3265 /* add device to alias management */
3264 dasd_alias_add_device(device); 3266 dasd_alias_add_device(device);