Commit 7c85615
committed
scsi: sd: Fix capacity calculation with 32-bit sector_t
We previously made sure that the reported disk capacity was less than
0xffffffff blocks when the kernel was not compiled with large sector_t
support (CONFIG_LBDAF). However, this check assumed that the capacity
was reported in units of 512 bytes.
Add a sanity check function to ensure that we only enable disks if the
entire reported capacity can be expressed in terms of sector_t.
Cc: <[email protected]>
Reported-by: Steve Magnani <[email protected]>
Cc: Bart Van Assche <[email protected]>
Reviewed-by: Bart Van Assche <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>1 parent bf6061b commit 7c85615
1 file changed
+18
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2102 | 2102 | | |
2103 | 2103 | | |
2104 | 2104 | | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
| 2109 | + | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
2105 | 2121 | | |
2106 | 2122 | | |
2107 | 2123 | | |
| |||
2167 | 2183 | | |
2168 | 2184 | | |
2169 | 2185 | | |
2170 | | - | |
| 2186 | + | |
2171 | 2187 | | |
2172 | 2188 | | |
2173 | 2189 | | |
| |||
2256 | 2272 | | |
2257 | 2273 | | |
2258 | 2274 | | |
2259 | | - | |
| 2275 | + | |
2260 | 2276 | | |
2261 | 2277 | | |
2262 | 2278 | | |
| |||
0 commit comments