diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2024-09-28 15:33:08 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-10-04 20:25:31 -0400 |
commit | fda7b1ffdef75cc0f4d34255e88b5894e2ce75b1 (patch) | |
tree | 71f895bc245490bd82c9c163752f26935b06ee04 | |
parent | 20826fe6b810bce3efba9ef5d74cf13ebe5f23d9 (diff) |
bcachefs: Create lost+found in correct snapshot
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
-rw-r--r-- | fs/bcachefs/fsck.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/bcachefs/fsck.c b/fs/bcachefs/fsck.c index 881ad5b9447f..f0d6696c4df6 100644 --- a/fs/bcachefs/fsck.c +++ b/fs/bcachefs/fsck.c @@ -284,10 +284,16 @@ static int lookup_lostfound(struct btree_trans *trans, u32 snapshot, create_lostfound: /* + * we always create lost+found in the root snapshot; we don't want + * different branches of the snapshot tree to have different lost+found + */ + snapshot = le32_to_cpu(st.root_snapshot); + /* * XXX: we could have a nicer log message here if we had a nice way to * walk backpointers to print a path */ - bch_notice(c, "creating lost+found in snapshot %u", le32_to_cpu(st.root_snapshot)); + bch_notice(c, "creating lost+found in subvol %llu snapshot %u", + root_inum.subvol, le32_to_cpu(st.root_snapshot)); u64 now = bch2_current_time(c); struct btree_iter lostfound_iter = { NULL }; |