Skip to content

Commit c522093

Browse files
alanskindKent Overstreet
authored andcommitted
bcachefs: Fix memmove when move keys down
The fix alone doesn't fix [1], but should be applied before debugging that. [1] https://syzkaller.appspot.com/bug?extid=38a0cbd267eff2d286ff Signed-off-by: Alan Huang <[email protected]> Signed-off-by: Kent Overstreet <[email protected]>
1 parent 68aaa63 commit c522093

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/bcachefs/btree_io.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -996,7 +996,7 @@ static int validate_bset_keys(struct bch_fs *c, struct btree *b,
996996
}
997997
got_good_key:
998998
le16_add_cpu(&i->u64s, -next_good_key);
999-
memmove_u64s_down(k, bkey_p_next(k), (u64 *) vstruct_end(i) - (u64 *) k);
999+
memmove_u64s_down(k, (u64 *) k + next_good_key, (u64 *) vstruct_end(i) - (u64 *) k);
10001000
set_btree_node_need_rewrite(b);
10011001
}
10021002
fsck_err:

0 commit comments

Comments
 (0)