* [PATCH] ext2: initialize opts.s_mount_opt as zero before using it
@ 2018-11-24 11:21 Hou Tao
2018-11-26 14:57 ` Jan Kara
0 siblings, 1 reply; 2+ messages in thread
From: Hou Tao @ 2018-11-24 11:21 UTC (permalink / raw)
To: linux-ext4; +Cc: xingaopeng, jack
From: xingaopeng <xingaopeng@huawei.com>
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")
Signed-off-by: xingaopeng <xingaopeng@huawei.com>
---
fs/ext2/super.c | 1 +
1 file changed, 1 insertion(+)
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)
--
2.16.2.dirty
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] ext2: initialize opts.s_mount_opt as zero before using it
2018-11-24 11:21 [PATCH] ext2: initialize opts.s_mount_opt as zero before using it Hou Tao
@ 2018-11-26 14:57 ` Jan Kara
0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2018-11-26 14:57 UTC (permalink / raw)
To: Hou Tao; +Cc: linux-ext4, xingaopeng, jack
On Sat 24-11-18 19:21:59, Hou Tao wrote:
> From: xingaopeng <xingaopeng@huawei.com>
>
> 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")
> Signed-off-by: xingaopeng <xingaopeng@huawei.com>
Thanks for catching this! I've added the patch to my tree.
Honza
> ---
> fs/ext2/super.c | 1 +
> 1 file changed, 1 insertion(+)
>
> 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)
> --
> 2.16.2.dirty
>
>
--
Jan Kara <jack@suse.com>
SUSE Labs, CR
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-11-27 1:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-24 11:21 [PATCH] ext2: initialize opts.s_mount_opt as zero before using it Hou Tao
2018-11-26 14:57 ` Jan Kara
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.