This is a note to let you know that I've just added the patch titled btrfs: reinsert BGs failed to reclaim to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: btrfs-reinsert-bgs-failed-to-reclaim.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 7e27180994383b7c741ad87749db01e4989a02ba Mon Sep 17 00:00:00 2001 From: Naohiro Aota <naota@xxxxxxxxx> Date: Tue, 6 Jun 2023 14:36:36 +0900 Subject: btrfs: reinsert BGs failed to reclaim From: Naohiro Aota <naota@xxxxxxxxx> commit 7e27180994383b7c741ad87749db01e4989a02ba upstream. 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: 18bb8bbf13c1 ("btrfs: zoned: automatically reclaim zones") CC: stable@xxxxxxxxxxxxxxx # 5.15+ Signed-off-by: Naohiro Aota <naohiro.aota@xxxxxxx> Signed-off-by: David Sterba <dsterba@xxxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/btrfs/block-group.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/btrfs/block-group.c +++ b/fs/btrfs/block-group.c @@ -1580,6 +1580,8 @@ void btrfs_reclaim_bgs_work(struct work_ } next: + if (ret) + btrfs_mark_bg_to_reclaim(bg); btrfs_put_block_group(bg); mutex_unlock(&fs_info->reclaim_bgs_lock); Patches currently in stable-queue which might be from naota@xxxxxxxxx are queue-5.15/btrfs-bail-out-reclaim-process-if-filesystem-is-read-only.patch queue-5.15/btrfs-move-out-now-unused-bg-from-the-reclaim-list.patch queue-5.15/btrfs-delete-unused-bgs-while-reclaiming-bgs.patch queue-5.15/btrfs-reinsert-bgs-failed-to-reclaim.patch