Skip to content

Commit fda7b1f

Browse files
author
Kent Overstreet
committed
bcachefs: Create lost+found in correct snapshot
Signed-off-by: Kent Overstreet <[email protected]>
1 parent 20826fe commit fda7b1f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

fs/bcachefs/fsck.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,17 @@ static int lookup_lostfound(struct btree_trans *trans, u32 snapshot,
283283
return ret;
284284

285285
create_lostfound:
286+
/*
287+
* we always create lost+found in the root snapshot; we don't want
288+
* different branches of the snapshot tree to have different lost+found
289+
*/
290+
snapshot = le32_to_cpu(st.root_snapshot);
286291
/*
287292
* XXX: we could have a nicer log message here if we had a nice way to
288293
* walk backpointers to print a path
289294
*/
290-
bch_notice(c, "creating lost+found in snapshot %u", le32_to_cpu(st.root_snapshot));
295+
bch_notice(c, "creating lost+found in subvol %llu snapshot %u",
296+
root_inum.subvol, le32_to_cpu(st.root_snapshot));
291297

292298
u64 now = bch2_current_time(c);
293299
struct btree_iter lostfound_iter = { NULL };

0 commit comments

Comments
 (0)