Commit a069f014 authored by Kent Overstreet's avatar Kent Overstreet
Browse files

bcachefs: Set bch_inode_unpacked.bi_snapshot in old inode path



This fixes a fsck bug on a very old filesystem (pre mainline merge).

Fixes: 72350ee0 ("bcachefs: Kill snapshot arg to fsck_write_inode()")
Reported-by: default avatarMarcin Mirosław <marcin@mejor.pl>
Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
parent e04ee860
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -283,6 +283,8 @@ static noinline int bch2_inode_unpack_slowpath(struct bkey_s_c k,
{
	memset(unpacked, 0, sizeof(*unpacked));

	unpacked->bi_snapshot = k.k->p.snapshot;

	switch (k.k->type) {
	case KEY_TYPE_inode: {
		struct bkey_s_c_inode inode = bkey_s_c_to_inode(k);