summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorxingaopeng <xingaopeng@huawei.com>2018-11-24 19:21:59 +0800
committerJan Kara <jack@suse.cz>2018-11-27 10:21:03 +0100
commite5f5b717983bccfa033282e9886811635602510e (patch)
tree3322f52b05b6c849c532d3abc696674272d2b491
parentb54e41f5efcb4316b2f30b30c2535cc194270373 (diff)
downloadlinux-e5f5b717983bccfa033282e9886811635602510e.tar.gz
linux-e5f5b717983bccfa033282e9886811635602510e.tar.bz2
linux-e5f5b717983bccfa033282e9886811635602510e.zip
ext2: initialize opts.s_mount_opt as zero before using it
We need to initialize opts.s_mount_opt as zero before using it, else we may get some unexpected mount options. Fixes: 088519572ca8 ("ext2: Parse mount options into a dedicated structure") CC: stable@vger.kernel.org Signed-off-by: xingaopeng <xingaopeng@huawei.com> Signed-off-by: Jan Kara <jack@suse.cz>
-rw-r--r--fs/ext2/super.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index cb91baa4275d..eb11502e3fcd 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -892,6 +892,7 @@ static int ext2_fill_super(struct super_block *sb, void *data, int silent)
if (sb->s_magic != EXT2_SUPER_MAGIC)
goto cantfind_ext2;
+ opts.s_mount_opt = 0;
/* Set defaults before we parse the mount options */
def_mount_opts = le32_to_cpu(es->s_default_mount_opts);
if (def_mount_opts & EXT2_DEFM_DEBUG)