From: Kent Overstreet Date: Sat, 3 Dec 2022 20:44:54 +0000 (-0500) Subject: bcachefs: Fix compat path for old inode formats X-Git-Tag: io_uring-6.7-2023-11-10~119^2~598 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=e9a1da97377f89f09e6b0b484554fe7a0e2dbe3e;p=linux-block.git bcachefs: Fix compat path for old inode formats Old inode formats don't have all the fields of the current inode format: when unpacking inodes in the current format we can thus skip zeroing out the destination buffer, but that doesn't work on for the old formats. Signed-off-by: Kent Overstreet --- diff --git a/fs/bcachefs/inode.c b/fs/bcachefs/inode.c index 141cf21e2951..6e7ba2e6fe33 100644 --- a/fs/bcachefs/inode.c +++ b/fs/bcachefs/inode.c @@ -213,6 +213,8 @@ static int bch2_inode_unpack_v2(struct bch_inode_unpacked *unpacked, int bch2_inode_unpack(struct bkey_s_c k, struct bch_inode_unpacked *unpacked) { + memset(unpacked, 0, sizeof(*unpacked)); + switch (k.k->type) { case KEY_TYPE_inode: { struct bkey_s_c_inode inode = bkey_s_c_to_inode(k);