diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-27 13:53:07 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-27 13:53:07 -0400 |
commit | 7250b2ee5574d7e2063c4498dde98ba11e2fd35f (patch) | |
tree | 044bf0d2fcebc0817a0e3a62855e77313571d15a | |
parent | 2351ebce6010e133336f7ac9905b44e37044573c (diff) |
bcachefs: Fix deleted inodes btree in snapshot deletion
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/snapshot.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/bcachefs/snapshot.c b/fs/bcachefs/snapshot.c index a3fecc785001..e9af77b384c7 100644 --- a/fs/bcachefs/snapshot.c +++ b/fs/bcachefs/snapshot.c @@ -1437,6 +1437,15 @@ int bch2_delete_dead_snapshots(struct bch_fs *c) if (!btree_type_has_snapshots(id)) continue; + /* + * deleted inodes btree is maintained by a trigger on the inodes + * btree - no work for us to do here, and it's not safe to scan + * it because we'll see out of date keys due to the btree write + * buffer: + */ + if (id == BTREE_ID_deleted_inodes) + continue; + ret = for_each_btree_key_commit(trans, iter, id, POS_MIN, BTREE_ITER_PREFETCH|BTREE_ITER_ALL_SNAPSHOTS, k, |