]> www.infradead.org Git - users/jedix/linux-maple.git/commit
bcachefs: Runtime self healing for keys for deleted snapshots
authorKent Overstreet <kent.overstreet@linux.dev>
Wed, 28 May 2025 02:20:27 +0000 (22:20 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 1 Jun 2025 02:03:17 +0000 (22:03 -0400)
commit0224d17d762ce036fde5ad18dd33236db6fca88b
treefedc47f64b3cbb9a96fcf1d4976be6cc9fdba5aa
parentf02d15327455822ed80e0b7d70b2ab3568a0389e
bcachefs: Runtime self healing for keys for deleted snapshots

If snapshot deletion incorrectly missing some keys and leaves keys for
deleted snapshots, that causes a bit of a problem for data move - we
can't move an extent for a nonexistent snapshot, because the extent
might have to be fragmented, and maintaining correct visibility in child
snapshots doesn't work if it doesn't have a snapshot.

Previously we'd just skip these keys, but it turns out that causes
copygc to spin.

So we need runtime self healing, i.e. calling check_key_has_snapshot()
from the data move path.

Snapshot deletion v2 included sentinal values for deleted snapshot
nodes, so this is quite safe.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/data_update.c