]> www.infradead.org Git - users/dwmw2/linux.git/commit
bcachefs: Fix snapshotting a subvolume, then renaming it
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 17 Apr 2025 18:09:56 +0000 (14:09 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Thu, 17 Apr 2025 18:17:16 +0000 (14:17 -0400)
commit261592ba06aa44001ab95fd47bafa4225bab25cf
treef478983a9cb0e922478638c6699abfa0fbc01d3e
parent8dd3804bf409095901b2b44b70e2e082f726f556
bcachefs: Fix snapshotting a subvolume, then renaming it

Subvolume roots and the dirents that point to them are special; they
don't obey the normal snapshot versioning rules because they cross
snapshot boundaries.

We don't keep around older versions of subvolume dirents on rename - we
don't need to, because subvolume dirents are only visible in the parent
subvolume, and we wouldn't be able to match up the different dirent and
inode versions due to crossing the snapshot ID boundary.

That means that when we rename a subvolume, that's been snapshotted, the
older version of the subvolume root will become dangling - it won't have
a dirent that points to it.

That's expected, we just need to tell fsck that this is ok.

Fixes: https://github.com/koverstreet/bcachefs/issues/856
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/fsck.c