summaryrefslogtreecommitdiff
path: root/fs/bcachefs/inode.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-11-14 01:57:52 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:17 +0300
commit1c9e6d50e28c89d03bebfe3e3946746dc1eeab74 (patch)
treebff5580c235b89480dc78a89b66493c5e5621183 /fs/bcachefs/inode.c
parent531b69e9afed954156b193264daf32c067454952 (diff)
downloadlinux-1c9e6d50e28c89d03bebfe3e3946746dc1eeab74.tar.xz
bcachefs: Fix missing field initialization
When unpacking v1 inodes, we were failing to initialize the journal_seq field, leading to a BUG_ON() when fsync tries to flush a garbage journal sequence number. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/inode.c')
-rw-r--r--fs/bcachefs/inode.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/bcachefs/inode.c b/fs/bcachefs/inode.c
index a24bbc5228c1..fb5ed3a07ad7 100644
--- a/fs/bcachefs/inode.c
+++ b/fs/bcachefs/inode.c
@@ -220,6 +220,7 @@ int bch2_inode_unpack(struct bkey_s_c k,
struct bkey_s_c_inode inode = bkey_s_c_to_inode(k);
unpacked->bi_inum = inode.k->p.offset;
+ unpacked->bi_journal_seq= 0;
unpacked->bi_hash_seed = inode.v->bi_hash_seed;
unpacked->bi_flags = le32_to_cpu(inode.v->bi_flags);
unpacked->bi_mode = le16_to_cpu(inode.v->bi_mode);