Skip to content

Commit 1e2d399

Browse files
author
Kent Overstreet
committed
bcachefs: Fix snapshot skiplists during snapshot deletion
In snapshot deleion, we have to pick new skiplist nodes for entries that point to nodes being deleted. The function that finds a new skiplist node, skipping over entries being deleted, was incorrect: if n = 0, but the parent node is being deleted, we also need to skip over that node. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
1 parent 4637429 commit 1e2d399

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

fs/bcachefs/snapshot.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1288,6 +1288,9 @@ static inline u32 bch2_snapshot_nth_parent_skip(struct bch_fs *c, u32 id, u32 n,
12881288
snapshot_id_list *skip)
12891289
{
12901290
rcu_read_lock();
1291+
while (snapshot_list_has_id(skip, id))
1292+
id = __bch2_snapshot_parent(c, id);
1293+
12911294
while (n--) {
12921295
do {
12931296
id = __bch2_snapshot_parent(c, id);

0 commit comments

Comments
 (0)