]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
bcachefs: Initialize from_inode members for bch_io_opts
authorRoxana Nicolescu <nicolescu.roxana@protonmail.com>
Tue, 11 Mar 2025 15:06:10 +0000 (15:06 +0000)
committerKent Overstreet <kent.overstreet@linux.dev>
Tue, 11 Mar 2025 15:19:33 +0000 (11:19 -0400)
When there is no inode source, all "from_inode" members in the structure
bhc_io_opts should be set false.

Fixes: 7a7c43a0c1ecf ("bcachefs: Add bch_io_opts fields for indicating whether the opts came from the inode")
Reported-by: syzbot+c17ad4b4367b72a853cb@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=c17ad4b4367b72a853cb
Signed-off-by: Roxana Nicolescu <nicolescu.roxana@protonmail.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/inode.c

index 04ec05206f8cfd5838c7e299cf9e05694edf7d06..339b80770f1dd60c16e370b1100aa84eb2a3b30f 100644 (file)
@@ -1198,6 +1198,7 @@ void bch2_inode_opts_get(struct bch_io_opts *opts, struct bch_fs *c,
                opts->_name##_from_inode = true;                        \
        } else {                                                        \
                opts->_name = c->opts._name;                            \
+               opts->_name##_from_inode = false;                       \
        }
        BCH_INODE_OPTS()
 #undef x