summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2022-12-03 15:44:54 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2022-12-03 15:44:54 -0500
commit70315f27c8053abec77df4a5046967fa66234032 (patch)
treef69b0643876bf4957f71cf5cac29c8b6fcfb6fec
parentc032c50894e7183b246a778222abfe2bef66f1d8 (diff)
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 <kent.overstreet@linux.dev>
-rw-r--r--fs/bcachefs/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/bcachefs/inode.c b/fs/bcachefs/inode.c
index 938c7b43d0b4..585d16ac2da2 100644
--- a/fs/bcachefs/inode.c
+++ b/fs/bcachefs/inode.c
@@ -269,6 +269,8 @@ static int bch2_inode_unpack_v3(struct bkey_s_c k,
static noinline int bch2_inode_unpack_slowpath(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);