]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
[S390] dasd: fix locking bug
authorStefan Haberland <stefan.haberland@de.ibm.com>
Wed, 14 Oct 2009 10:43:46 +0000 (12:43 +0200)
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>
Wed, 14 Oct 2009 10:43:52 +0000 (12:43 +0200)
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>
drivers/s390/block/dasd_eckd.c

index 0be7c15f45c56be97907811f8deec45b3f329de8..417b97cd3f9495cee6ba74116dcfaa0bb836d9f2 100644 (file)
@@ -3216,6 +3216,7 @@ int dasd_eckd_restore_device(struct dasd_device *device)
        struct dasd_eckd_characteristics temp_rdc_data;
        int is_known, rc;
        struct dasd_uid temp_uid;
+       unsigned long flags;
 
        private = (struct dasd_eckd_private *) device->private;
 
@@ -3228,7 +3229,8 @@ int dasd_eckd_restore_device(struct dasd_device *device)
        rc = dasd_eckd_generate_uid(device, &private->uid);
        dasd_get_uid(device->cdev, &temp_uid);
        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)
                goto out_err;
        dasd_set_uid(device->cdev, &private->uid);
@@ -3256,9 +3258,9 @@ int dasd_eckd_restore_device(struct dasd_device *device)
                          "device: %s", rc, dev_name(&device->cdev->dev));
                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));
-       spin_unlock(get_ccwdev_lock(device->cdev));
+       spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
 
        /* add device to alias management */
        dasd_alias_add_device(device);