Re: [PATCH] block: Drop granularity check in queue_limit_discard_alignment()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux