]> 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)
committerDavid Sterba <dsterba@suse.com>
Fri, 30 Oct 2026 20:36:17 +0000 (21:36 +0100)
commitf1c9219fdd39cef3016ceb7f7a73bbe075108114
tree8272750b681c7f940459ad28c2696025e9583612
parentaa5b989352093aeebb4ad85ca9fc94667cf6f7ef
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.

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