]> www.infradead.org Git - users/hch/dma-mapping.git/commit
bcachefs: reattach_inode() now correctly handles interior snapshot nodes
authorKent Overstreet <kent.overstreet@linux.dev>
Mon, 30 Sep 2024 23:03:19 +0000 (19:03 -0400)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 6 Oct 2024 07:03:45 +0000 (03:03 -0400)
commit38864eccf78b4e8ab9e2b7a4320943b1feb6872a
treec73445476b7f5e9ef9dde3915a09c746e969d3f7
parentbade9711e0905eaa99e2ed98fc9642acaf9ba2b5
bcachefs: reattach_inode() now correctly handles interior snapshot nodes

When we find an unreachable inode, we now reattach it in the oldest
version that needs to be reattached (thus avoiding redundant work
reattaching every single version), and we now fix up inode -> dirent
backpointers in newer versions as needed - or white out the reattaching
dirent in newer versions, if the newer version isn't supposed to be
reattached.

This results in the second verify fsck now passing cleanly after
repairing on a user-provided filesystem image with thousands of
different snapshots.

Reported-by: Christopher Snowhill <chris@kode54.net>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/btree_iter.h
fs/bcachefs/fsck.c