Commit 6780414
scsi: sd: Consider max_xfer_blocks if opt_xfer_blocks is unusable
If device reports a small max_xfer_blocks and a zero opt_xfer_blocks, we
end up using BLK_DEF_MAX_SECTORS, which is wrong and r/w of that size
may get error.
[mkp: tweaked to avoid setting rw_max twice and added typecast]
Cc: <[email protected]> # v4.4+
Fixes: ca369d5 ("block/sd: Fix device-imposed transfer length limits")
Signed-off-by: Fam Zheng <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>1 parent a3902ee commit 6780414
1 file changed
+2
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2956 | 2956 | | |
2957 | 2957 | | |
2958 | 2958 | | |
2959 | | - | |
| 2959 | + | |
| 2960 | + | |
2960 | 2961 | | |
2961 | 2962 | | |
2962 | 2963 | | |
| |||
0 commit comments