[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250825083320.797165-3-yi.zhang@huaweicloud.com>
Date: Mon, 25 Aug 2025 16:33:20 +0800
From: Zhang Yi <yi.zhang@...weicloud.com>
To: linux-block@...r.kernel.org,
linux-raid@...r.kernel.org,
drbd-dev@...ts.linbit.com
Cc: linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
john.g.garry@...cle.com,
hch@....de,
martin.petersen@...cle.com,
axboe@...nel.dk,
yi.zhang@...wei.com,
yi.zhang@...weicloud.com,
yukuai3@...wei.com,
yangerkun@...wei.com
Subject: [PATCH 2/2] drbd: init queue_limits->max_hw_wzeroes_unmap_sectors parameter
From: Zhang Yi <yi.zhang@...wei.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@...wei.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) {
--
2.46.1
Powered by blists - more mailing lists