On 12/11/2024 09:21, John Garry wrote:
lim->discard_granularity is always at least SECTOR_SIZE, so drop the
pointless check for granularity less than SECTOR_SIZE.
Signed-off-by: John Garry <john.g.garry@xxxxxxxxxx>
Just a reminder in case this can still make v6.13
I wouldn't say that it is a fix.
Thanks,
John
diff --git a/block/blk-settings.c b/block/blk-settings.c
index 7d6b296997c2..4091794c5a1c 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -457,8 +457,6 @@ static unsigned int queue_limit_discard_alignment(
/* Why are these in bytes, not sectors? */
alignment = lim->discard_alignment >> SECTOR_SHIFT;
granularity = lim->discard_granularity >> SECTOR_SHIFT;
- if (!granularity)
- return 0;
/* Offset of the partition start in 'granularity' sectors */
offset = sector_div(sector, granularity);