Skip to content

Commit 027a7a9

Browse files
zhangyi089axboe
authored andcommitted
drbd: init queue_limits->max_hw_wzeroes_unmap_sectors parameter
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: 0c40d7c ("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> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent de09bcb commit 027a7a9

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

drivers/block/drbd/drbd_nl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1330,6 +1330,7 @@ void drbd_reconsider_queue_parameters(struct drbd_device *device,
13301330
lim.max_write_zeroes_sectors = DRBD_MAX_BBIO_SECTORS;
13311331
else
13321332
lim.max_write_zeroes_sectors = 0;
1333+
lim.max_hw_wzeroes_unmap_sectors = 0;
13331334

13341335
if ((lim.discard_granularity >> SECTOR_SHIFT) >
13351336
lim.max_hw_discard_sectors) {

0 commit comments

Comments
 (0)