[SCSI] sd: Always do write-protect check
authorAlan Stern <stern@rowland.harvard.edu>
Fri, 9 Dec 2005 16:34:45 +0000 (11:34 -0500)
committerJames Bottomley <jejb@mulgrave.(none)>
Wed, 14 Dec 2005 01:49:18 +0000 (18:49 -0700)
Since nobody has offered an explanation for why the sd driver makes a
write-protect check only for devices with removable media, I'm submitting
this patch to get rid of the removable-media test.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/sd.c

index 8613a1317712c9d40df22c26dc546d1c8b6aea28..d82795455efb3aa88262b3743476b57cc1850165 100644 (file)
@@ -1509,9 +1509,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
         */
        if (sdkp->media_present) {
                sd_read_capacity(sdkp, disk->disk_name, buffer);
-               if (sdp->removable)
-                       sd_read_write_protect_flag(sdkp, disk->disk_name,
-                                                  buffer);
+               sd_read_write_protect_flag(sdkp, disk->disk_name, buffer);
                sd_read_cache_type(sdkp, disk->disk_name, buffer);
        }