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>2023-01-06 19:48:00 -0500
commit4f826b1cb7d83bdd8f3a0c7b1bf7f157d683401a (patch)
tree57ca61c9f6c6efd90627b3cdaca447919e90e0f4
parent3994ad3daabf4598d60cb2b1cafbd2c1fd035723 (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);