Skip to content

Commit

Permalink
btrfs: validate queue limits
Browse files Browse the repository at this point in the history
Call blk_validate_limits on the queue limits used for zone append
splitting so that calculated values get filled in and any stacking
conflicts get cought.

Without this there isn't a max_zone_append_sectors limits as of commit
559218d ("block: pre-calculate max_zone_append_sectors").

Fixes: 559218d ("block: pre-calculate max_zone_append_sectors")
Reported-by: Yi Zhang <yi.zhang@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Link: https://lore.kernel.org/r/20241113084541.34315-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Nov 13, 2024
1 parent 470d2bc commit e559ee0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions fs/btrfs/zoned.c
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,12 @@ int btrfs_check_zoned_mode(struct btrfs_fs_info *fs_info)
blk_stack_limits(lim, bdev_limits(device->bdev), 0);
}

ret = blk_validate_limits(lim);
if (ret) {
btrfs_err(fs_info, "zoned: failed to validate queue limits");
return ret;
}

/*
* stripe_size is always aligned to BTRFS_STRIPE_LEN in
* btrfs_create_chunk(). Since we want stripe_len == zone_size,
Expand Down

0 comments on commit e559ee0

Please sign in to comment.