Wrong size information for devices with disabled read access
PATCH 1/1 Wrong size information for devices with disabled read access
Hi James,
when accessing a device with disabled read access the capacity is set somewhat arbitrary to 1GB. This makes it quite impossible for userspace applications to detect this as an invalid capacity.
And it is inconsistent with other error conditions, where the capacity is in fact set to 0.
Please apply.
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke [email protected] SuSE Linux Products GmbH S390 & zSeries Maxfeldstraße 5 +49 911 74053 688 90409 Nürnberg http://www.suse.de
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 Mike Anderson <[email protected]>
Acked-by Chris Mason <[email protected]>
Signed-off-by Hannes Reinecke <[email protected]>
drivers/scsi/sd.c +1 -1
@@ -1215,7 +1215,7 @@ repeat:/* 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) {