]> git.hungrycats.org Git - linux/commit
btrfs: zoned: requeue block group if zone reset bails out
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>
Thu, 10 Sep 2026 12:19:39 +0000 (14:19 +0200)
committerJohannes Thumshirn <johannes.thumshirn@wdc.com>
Wed, 21 Oct 2026 08:03:34 +0000 (10:03 +0200)
commitfcf5f76d5ec766f7c498ff59454b24021f086efe
tree85be599dea06d1ebc0ba3acc6500284e9beb1713
parentbe3b6cfc3b511d3717d4f691915003829092e54f
btrfs: zoned: requeue block group if zone reset bails out

btrfs_reset_unused_block_groups() drops the block-group from
fs_info->unused_bgs before performing the work that can actually fail,
the actual submission of a REQ_OP_ZONE_RESET.

Every failed operation after this leaves the block-group dangling,
physically reset, but the in-memory structures aren't and it is not
requeued to be reset on fs_info->unused_bgs.

Instead of bailing out, re-add this block-group to fs_info->unused_bgs
list.

Reviewed-by: Daniel Vacek <neelx@suse.com>
Fixes: 453a73c3069a ("btrfs: zoned: reclaim unused zone by zone resetting")
Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
fs/btrfs/zoned.c