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 <kent.overstreet@linux.dev>
Reported-and-tested-by: s@m-h.ug
This commit is contained in:
Kent Overstreet 2024-04-21 23:32:18 -04:00
parent 0e42f38119
commit e858beeddf

View File

@ -1960,7 +1960,11 @@ int __bch2_foreground_maybe_merge(struct btree_trans *trans,
if ((flags & BCH_WATERMARK_MASK) == BCH_WATERMARK_interior_updates)
return 0;
flags &= ~BCH_WATERMARK_MASK;
if ((flags & BCH_WATERMARK_MASK) <= BCH_WATERMARK_reclaim) {
flags &= ~BCH_WATERMARK_MASK;
flags |= BCH_WATERMARK_btree;
flags |= BCH_TRANS_COMMIT_journal_reclaim;
}
b = trans->paths[path].l[level].b;