Skip to content

Commit 7e27180

Browse files
naotakdave
authored andcommitted
btrfs: reinsert BGs failed to reclaim
The reclaim process can temporarily fail. For example, if the space is getting tight, it fails to make the block group read-only. If there are no further writes on that block group, the block group will never get back to the reclaim list, and the BG never gets reclaimed. In a certain workload, we can leave many such block groups never reclaimed. So, let's get it back to the list and give it a chance to be reclaimed. Fixes: 18bb8bb ("btrfs: zoned: automatically reclaim zones") CC: [email protected] # 5.15+ Signed-off-by: Naohiro Aota <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent 93463ff commit 7e27180

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/block-group.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1833,6 +1833,8 @@ void btrfs_reclaim_bgs_work(struct work_struct *work)
18331833
}
18341834

18351835
next:
1836+
if (ret)
1837+
btrfs_mark_bg_to_reclaim(bg);
18361838
btrfs_put_block_group(bg);
18371839

18381840
mutex_unlock(&fs_info->reclaim_bgs_lock);

0 commit comments

Comments
 (0)