Commit 69bdd88c authored by Hannes Reinecke's avatar Hannes Reinecke Committed by James Bottomley

[SCSI] Wrong size information for devices with disabled read access

When accessing a device with disabled read access the capacity is set
randomly to 1GB. This makes it impossible to userspace tools to detect
invalid device capacities.
Signed-off-by: default avatarMike Anderson <andmike@us.ibm.com>
Acked-by: default avatarChris Mason <mason@suse.com>
Signed-off-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 01dfc7fc
...@@ -1215,7 +1215,7 @@ sd_read_capacity(struct scsi_disk *sdkp, char *diskname, ...@@ -1215,7 +1215,7 @@ sd_read_capacity(struct scsi_disk *sdkp, char *diskname,
/* Either no media are present but the drive didn't tell us, /* Either no media are present but the drive didn't tell us,
or they are present but the read capacity command fails */ or they are present but the read capacity command fails */
/* sdkp->media_present = 0; -- not always correct */ /* sdkp->media_present = 0; -- not always correct */
sdkp->capacity = 0x200000; /* 1 GB - random */ sdkp->capacity = 0; /* unknown mapped to zero - as usual */
return; return;
} else if (the_result && longrc) { } else if (the_result && longrc) {
......
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