From 0dd092bf1091a114f22136e5776aec21e6e4af2a Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Thu, 19 Oct 2023 15:23:56 -0400 Subject: 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: Kent Overstreet --- fs/bcachefs/snapshot.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/bcachefs/snapshot.c') diff --git a/fs/bcachefs/snapshot.c b/fs/bcachefs/snapshot.c index 4982468bfe11..5a62d2e14cb4 100644 --- a/fs/bcachefs/snapshot.c +++ b/fs/bcachefs/snapshot.c @@ -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, -- cgit v1.2.3