diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2022-12-03 15:44:54 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-02-03 21:48:49 -0500 |
commit | 136986f8d62709190b30a421b8c17f1f3b6ece9f (patch) | |
tree | 0d42a1b2626903f8d8c2de6b7723686eff227eb7 | |
parent | 73e43c70781c44f8e32cbfeec9b2c5af21cb82af (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.c | 2 |
1 files changed, 2 insertions, 0 deletions
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); |