Commit 5a8b827
block: ensure discard_granularity is zero when discard is not supported
Documentation/ABI/stable/sysfs-block states:
What: /sys/block/<disk>/queue/discard_granularity
[...]
A discard_granularity of 0 means that the device does not support
discard functionality.
but this got broken when sorting out the block limits updates. Fix this
by setting the discard_granularity limit to zero when the combined
max_discard_sectors is zero.
Fixes: 3c407dc ("block: default the discard granularity to sector size")
Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Martin K. Petersen <[email protected]>1 parent 4c26e9a commit 5a8b827
1 file changed
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
388 | 388 | | |
389 | 389 | | |
390 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
391 | 401 | | |
392 | 402 | | |
393 | 403 | | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | 404 | | |
398 | 405 | | |
399 | 406 | | |
| |||
0 commit comments