Skip to content

Commit 544e4f9

Browse files
naotakdave
authored andcommitted
btrfs: zoned: requeue to unused block group list if zone finish failed
btrfs_zone_finish() can fail for several reason. If it is -EAGAIN, we need to try it again later. So, put the block group to the retry list properly. Failing to do so will keep the removable block group intact until remount and can causes unnecessary ENOSPC. Fixes: 74e91b1 ("btrfs: zoned: zone finish unused block group") CC: [email protected] # 6.1+ Reviewed-by: Johannes Thumshirn <[email protected]> Signed-off-by: Naohiro Aota <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 1af4595 commit 544e4f9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/btrfs/block-group.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1639,8 +1639,10 @@ void btrfs_delete_unused_bgs(struct btrfs_fs_info *fs_info)
16391639
ret = btrfs_zone_finish(block_group);
16401640
if (ret < 0) {
16411641
btrfs_dec_block_group_ro(block_group);
1642-
if (ret == -EAGAIN)
1642+
if (ret == -EAGAIN) {
1643+
btrfs_link_bg_list(block_group, &retry_list);
16431644
ret = 0;
1645+
}
16441646
goto next;
16451647
}
16461648

0 commit comments

Comments
 (0)