Commit 74fbc88
committed
nvme-core: check for too small lba shift
The block layer doesn't support logical block sizes smaller than 512
bytes. The nvme spec doesn't support that small either, but the driver
isn't checking to make sure the device responded with usable data.
Failing to catch this will result in a kernel bug, either from a
division by zero when stacking, or a zero length bio.
Reviewed-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Keith Busch <kbusch@kernel.org>1 parent d8b90d6 commit 74fbc88
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1901 | 1901 | | |
1902 | 1902 | | |
1903 | 1903 | | |
1904 | | - | |
| 1904 | + | |
| 1905 | + | |
1905 | 1906 | | |
1906 | | - | |
| 1907 | + | |
1907 | 1908 | | |
1908 | 1909 | | |
1909 | 1910 | | |
| |||
0 commit comments