From: Kent Overstreet Date: Thu, 19 Oct 2023 19:23:56 +0000 (-0400) Subject: bcachefs: Fix lock ordering with snapshot_create_lock X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=0dd092bf1091a114f22136e5776aec21e6e4af2a;p=linux.git 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 --- diff --git a/fs/bcachefs/snapshot.c b/fs/bcachefs/snapshot.c index 4982468bfe118..5a62d2e14cb4b 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,