Skip to content

Commit

Permalink
[SCSI] Wrong size information for devices with disabled read access
Browse files Browse the repository at this point in the history
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: Mike Anderson <andmike@us.ibm.com>
Acked-by: Chris Mason <mason@suse.com>
Signed-off-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
  • Loading branch information
Hannes Reinecke authored and James Bottomley committed Sep 2, 2006
1 parent 01dfc7f commit 69bdd88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
or they are present but the read capacity command fails */
/* sdkp->media_present = 0; -- not always correct */
sdkp->capacity = 0x200000; /* 1 GB - random */
sdkp->capacity = 0; /* unknown mapped to zero - as usual */

return;
} else if (the_result && longrc) {
Expand Down

0 comments on commit 69bdd88

Please sign in to comment.