Skip to content

Commit 0ef9ab3

Browse files
alanskindKent Overstreet
authored andcommitted
bcachefs: Do not allow no fail lock request to fail
If the transaction chose itself as a victim before and restarted, it might request a no fail lock request this time. But it might be added to others' lock graph and be chose as the victim again, it's no longer safe without additional check. We can also convert the cycle detector to be fully RCU-based to solve that unsoundness, but the latency added to trans_put and additional memory required may not worth it. Signed-off-by: Alan Huang <mmpgouride@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent cdc419d commit 0ef9ab3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/bcachefs/btree_locking.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ int bch2_check_for_deadlock(struct btree_trans *trans, struct printbuf *cycle)
281281

282282
g.nr = 0;
283283

284-
if (trans->lock_must_abort) {
284+
if (trans->lock_must_abort && !trans->lock_may_not_fail) {
285285
if (cycle)
286286
return -1;
287287

0 commit comments

Comments
 (0)