From 1c9e6d50e28c89d03bebfe3e3946746dc1eeab74 Mon Sep 17 00:00:00 2001 From: Kent Overstreet Date: Sat, 13 Nov 2021 17:57:52 -0500 Subject: 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 --- fs/bcachefs/inode.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/bcachefs/inode.c') 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); -- cgit v1.2.3