Commit 0dd092bf authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Fix lock ordering with snapshot_create_lock



We must not hold btree locks while taking snapshot_create_lock - this
fixes a lockdep splat.

Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent 20e425d3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1447,6 +1447,7 @@ int bch2_delete_dead_snapshots(struct bch_fs *c)
		}
	}

	bch2_trans_unlock(trans);
	down_write(&c->snapshot_create_lock);

	for_each_btree_key(trans, iter, BTREE_ID_snapshots,