]> Git Repo - linux.git/commitdiff
[SCSI] Wrong size information for devices with disabled read access
authorHannes Reinecke <[email protected]>
Fri, 1 Sep 2006 13:50:23 +0000 (15:50 +0200)
committerJames Bottomley <[email protected]>
Sat, 2 Sep 2006 18:37:47 +0000 (13:37 -0500)
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]>
Signed-off-by: James Bottomley <[email protected]>
drivers/scsi/sd.c

index 98bd3aab9739114f6b4dd1a538928856929fe7a5..638cff41d436777fa85afc31dfd6213f227b2637 100644 (file)
@@ -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) {
This page took 0.054139 seconds and 4 git commands to generate.