Linux block layer
 help / color / mirror / Atom feed
From: Hannes Reinecke <hare@suse.de>
To: Zhang Yi <yi.zhang@huaweicloud.com>,
	linux-block@vger.kernel.org, linux-raid@vger.kernel.org,
	drbd-dev@lists.linbit.com
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	john.g.garry@oracle.com, pmenzel@molgen.mpg.de, hch@lst.de,
	martin.petersen@oracle.com, axboe@kernel.dk, yi.zhang@huawei.com,
	yukuai3@huawei.com, yangerkun@huawei.com
Subject: Re: [PATCH v2 2/2] drbd: init queue_limits->max_hw_wzeroes_unmap_sectors parameter
Date: Wed, 10 Sep 2025 13:41:36 +0200	[thread overview]
Message-ID: <a0834448-35dd-401f-8d66-a957b8e160b2@suse.de> (raw)
In-Reply-To: <20250910111107.3247530-3-yi.zhang@huaweicloud.com>

On 9/10/25 13:11, Zhang Yi wrote:
> From: Zhang Yi <yi.zhang@huawei.com>
> 
> The parameter max_hw_wzeroes_unmap_sectors in queue_limits should be
> equal to max_write_zeroes_sectors if it is set to a non-zero value.
> However, when the backend bdev is specified, this parameter is
> initialized to UINT_MAX during the call to blk_set_stacking_limits(),
> while only max_write_zeroes_sectors is adjusted. Therefore, this
> discrepancy triggers a value check failure in blk_validate_limits().
> 
> Since the drvd driver doesn't yet support unmap write zeroes, so fix
> this failure by explicitly setting max_hw_wzeroes_unmap_sectors to
> zero.
> 
> Fixes: 0c40d7cb5ef3 ("block: introduce max_{hw|user}_wzeroes_unmap_sectors to queue limits")
> Signed-off-by: Zhang Yi <yi.zhang@huawei.com>
> Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
> Reviewed-by: Yu Kuai <yukuai3@huawei.com>
> ---
>   drivers/block/drbd/drbd_nl.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
> index e09930c2b226..91f3b8afb63c 100644
> --- a/drivers/block/drbd/drbd_nl.c
> +++ b/drivers/block/drbd/drbd_nl.c
> @@ -1330,6 +1330,7 @@ void drbd_reconsider_queue_parameters(struct drbd_device *device,
>   		lim.max_write_zeroes_sectors = DRBD_MAX_BBIO_SECTORS;
>   	else
>   		lim.max_write_zeroes_sectors = 0;
> +	lim.max_hw_wzeroes_unmap_sectors = 0;
>   
>   	if ((lim.discard_granularity >> SECTOR_SHIFT) >
>   	    lim.max_hw_discard_sectors) {
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke                  Kernel Storage Architect
hare@suse.de                                +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich

  reply	other threads:[~2025-09-10 11:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-10 11:11 [PATCH v2 0/2] Fix the initialization of max_hw_wzeroes_unmap_sectors for stacking drivers Zhang Yi
2025-09-10 11:11 ` [PATCH v2 1/2] md: init queue_limits->max_hw_wzeroes_unmap_sectors parameter Zhang Yi
2025-09-10 11:41   ` Hannes Reinecke
2025-09-17  1:20   ` Yu Kuai
2025-09-10 11:11 ` [PATCH v2 2/2] drbd: " Zhang Yi
2025-09-10 11:41   ` Hannes Reinecke [this message]
2025-09-12  6:16 ` [PATCH v2 0/2] Fix the initialization of max_hw_wzeroes_unmap_sectors for stacking drivers Zhang Yi
2025-09-15 10:43   ` John Garry
2025-09-16  0:49     ` Yu Kuai
2025-09-17 14:21 ` (subset) " Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a0834448-35dd-401f-8d66-a957b8e160b2@suse.de \
    --to=hare@suse.de \
    --cc=axboe@kernel.dk \
    --cc=drbd-dev@lists.linbit.com \
    --cc=hch@lst.de \
    --cc=john.g.garry@oracle.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=pmenzel@molgen.mpg.de \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yi.zhang@huaweicloud.com \
    --cc=yukuai3@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox