bcachefs: Clear trans->locked before unlock
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 22 May 2025 20:04:15 +0000 (16:04 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Fri, 23 May 2025 11:59:43 +0000 (07:59 -0400)
We're adding new should_be_locked assertions: it's going to be illegal
to unlock a should_be_locked path when trans->locked is true.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_locking.c

index 78f485ed174696b9c0666036650ed77b1ea16f90..826930b4b1645c0197d354482c2a8e29d85d91bd 100644 (file)
@@ -846,9 +846,9 @@ int bch2_trans_relock_notrace(struct btree_trans *trans)
 
 void bch2_trans_unlock(struct btree_trans *trans)
 {
-       __bch2_trans_unlock(trans);
-
        trans_set_unlocked(trans);
+
+       __bch2_trans_unlock(trans);
 }
 
 void bch2_trans_unlock_long(struct btree_trans *trans)