Skip to content

Commit e858bee

Browse files
author
Kent Overstreet
committed
bcachefs: If we run merges at a lower watermark, they must be nonblocking
Fix another deadlock related to the merge path; previously, we switched to always running merges at a lower watermark (because they are noncritical); but when we run at a lower watermark we also need to run nonblocking or we've introduced a new deadlock. Signed-off-by: Kent Overstreet <[email protected]> Reported-and-tested-by: [email protected]
1 parent 0e42f38 commit e858bee

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

fs/bcachefs/btree_update_interior.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1960,7 +1960,11 @@ int __bch2_foreground_maybe_merge(struct btree_trans *trans,
19601960
if ((flags & BCH_WATERMARK_MASK) == BCH_WATERMARK_interior_updates)
19611961
return 0;
19621962

1963-
flags &= ~BCH_WATERMARK_MASK;
1963+
if ((flags & BCH_WATERMARK_MASK) <= BCH_WATERMARK_reclaim) {
1964+
flags &= ~BCH_WATERMARK_MASK;
1965+
flags |= BCH_WATERMARK_btree;
1966+
flags |= BCH_TRANS_COMMIT_journal_reclaim;
1967+
}
19641968

19651969
b = trans->paths[path].l[level].b;
19661970

0 commit comments

Comments
 (0)