bcachefs: Fix reattach_inode() for snapshots
authorKent Overstreet <kent.overstreet@linux.dev>
Fri, 15 Dec 2023 19:13:48 +0000 (14:13 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Mon, 1 Jan 2024 16:47:44 +0000 (11:47 -0500)
commitd296e7b18521d60e3c428945c19a66ecf012c002
tree09de01a31624a56caa6fab1e1b23c9da6be07ad1
parentc558c577cbea95d8a8efc161cad93bab344a61d0
bcachefs: Fix reattach_inode() for snapshots

reattach_inode() was broken w.r.t. snapshots - we'd lookup the subvolume
to look up lost+found, but if we're in an interior node snapshot that
didn't make any sense.

Instead, this adds a dirent path for creating in a specific snapshot,
skipping the subvolume; and we also make sure to create lost+found in
the root snapshot, to avoid conflicts with lost+found being created in
overlapping snapshots.

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