* [PATCH] block: Drop granularity check in queue_limit_discard_alignment()
@ 2024-11-12 9:21 John Garry
2024-11-12 17:22 ` Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: John Garry @ 2024-11-12 9:21 UTC (permalink / raw)
To: axboe, hch; +Cc: linux-block, John Garry
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@oracle.com>
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);
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] block: Drop granularity check in queue_limit_discard_alignment()
2024-11-12 9:21 [PATCH] block: Drop granularity check in queue_limit_discard_alignment() John Garry
@ 2024-11-12 17:22 ` Christoph Hellwig
2024-11-19 16:05 ` John Garry
2024-11-19 16:10 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2024-11-12 17:22 UTC (permalink / raw)
To: John Garry; +Cc: axboe, hch, linux-block
On Tue, Nov 12, 2024 at 09:21:44AM +0000, John Garry wrote:
> lim->discard_granularity is always at least SECTOR_SIZE, so drop the
> pointless check for granularity less than SECTOR_SIZE.
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: Drop granularity check in queue_limit_discard_alignment()
2024-11-12 9:21 [PATCH] block: Drop granularity check in queue_limit_discard_alignment() John Garry
2024-11-12 17:22 ` Christoph Hellwig
@ 2024-11-19 16:05 ` John Garry
2024-11-19 16:10 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: John Garry @ 2024-11-19 16:05 UTC (permalink / raw)
To: axboe, hch; +Cc: linux-block
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@oracle.com>
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);
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] block: Drop granularity check in queue_limit_discard_alignment()
2024-11-12 9:21 [PATCH] block: Drop granularity check in queue_limit_discard_alignment() John Garry
2024-11-12 17:22 ` Christoph Hellwig
2024-11-19 16:05 ` John Garry
@ 2024-11-19 16:10 ` Jens Axboe
2 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2024-11-19 16:10 UTC (permalink / raw)
To: hch, John Garry; +Cc: linux-block
On Tue, 12 Nov 2024 09:21:44 +0000, John Garry wrote:
> lim->discard_granularity is always at least SECTOR_SIZE, so drop the
> pointless check for granularity less than SECTOR_SIZE.
>
>
Applied, thanks!
[1/1] block: Drop granularity check in queue_limit_discard_alignment()
commit: e924da7d6622b72f9eee78a3aad3e75b859da341
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-11-19 16:10 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-12 9:21 [PATCH] block: Drop granularity check in queue_limit_discard_alignment() John Garry
2024-11-12 17:22 ` Christoph Hellwig
2024-11-19 16:05 ` John Garry
2024-11-19 16:10 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox