Commit 4eb4e85
btrfs: retry block group reclaim without infinite loop
If inc_block_group_ro systematically fails (e.g. due to ETXTBUSY from
swap) or btrfs_relocate_chunk systematically fails (from lack of
space), then this worker becomes an infinite loop.
At the very least, this strands the cleaner thread, but can also result
in hung tasks/RCU stalls on PREEMPT_NONE kernels and if the
reclaim_bgs_lock mutex is not contended.
I believe the best long term fix is to manage reclaim via work queue,
where we queue up a relocation on the triggering condition and re-queue
on failure. In the meantime, this is an easy fix to apply to avoid the
immediate pain.
Fixes: 7e27180 ("btrfs: reinsert BGs failed to reclaim")
CC: stable@vger.kernel.org # 6.6+
Signed-off-by: Boris Burkov <boris@bur.io>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent f3a5367 commit 4eb4e85
1 file changed
+9
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1785 | 1785 | | |
1786 | 1786 | | |
1787 | 1787 | | |
| 1788 | + | |
1788 | 1789 | | |
1789 | 1790 | | |
1790 | 1791 | | |
| |||
1921 | 1922 | | |
1922 | 1923 | | |
1923 | 1924 | | |
1924 | | - | |
1925 | | - | |
| 1925 | + | |
| 1926 | + | |
| 1927 | + | |
| 1928 | + | |
| 1929 | + | |
1926 | 1930 | | |
1927 | 1931 | | |
1928 | 1932 | | |
| |||
1942 | 1946 | | |
1943 | 1947 | | |
1944 | 1948 | | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
1945 | 1952 | | |
1946 | 1953 | | |
1947 | 1954 | | |
| |||
0 commit comments