From: Zhe Li <lizhe67@huawei.com>
To: <linux-mtd@lists.infradead.org>, <lizhe67@huawei.com>,
<dwmw2@infradead.org>, <richard@nod.at>
Cc: zhongjubin@huawei.com, wangfangpeng1@huawei.com,
linux-kernel@vger.kernel.org, qiuxi1@huawei.com,
chenjie6@huawei.com
Subject: Re: [PATCH 1/2] jffs2: fix ignoring mounting options problem during remounting
Date: Fri, 6 Nov 2020 10:30:02 +0800 [thread overview]
Message-ID: <20201106023002.12752-1-lizhe67@huawei.com> (raw)
In-Reply-To: <20201014065443.18512-1-lizhe67@huawei.com>
Maintainer ping?
Zhe
On Tue, 13 Oct 2020 15:22:37 +0800, Zhe Li wrote:
>
>The jffs2 mount options will be ignored when remounting jffs2.
>It can be easily reproduced with the steps listed below.
>1. mount -t jffs2 -o compr=none /dev/mtdblockx /mnt
>2. mount -o remount compr=zlib /mnt
>
>Since ec10a24f10c8, the option parsing happens before fill_super and
>then pass fc, which contains the options parsing results, to function
>jffs2_reconfigure during remounting. But function jffs2_reconfigure do
>not update c->mount_opts.
>
>This patch add a function jffs2_update_mount_opts to fix this problem.
>
>By the way, I notice that tmpfs use the same way to update remounting
>options. If it is necessary to unify them?
>
>Signed-off-by: lizhe <lizhe67@huawei.com>
>---
> fs/jffs2/super.c | 17 +++++++++++++++++
> 1 file changed, 17 insertions(+)
>
>diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
>index 05d7878dfad1..4fd297bdf0f3 100644
>--- a/fs/jffs2/super.c
>+++ b/fs/jffs2/super.c
>@@ -215,11 +215,28 @@ static int jffs2_parse_param(struct fs_context *fc, struct fs_parameter *param)
> return 0;
> }
>
>+static inline void jffs2_update_mount_opts(struct fs_context *fc)
>+{
>+ struct jffs2_sb_info *new_c = fc->s_fs_info;
>+ struct jffs2_sb_info *c = JFFS2_SB_INFO(fc->root->d_sb);
>+
>+ mutex_lock(&c->alloc_sem);
>+ if (new_c->mount_opts.override_compr) {
>+ c->mount_opts.override_compr = new_c->mount_opts.override_compr;
>+ c->mount_opts.compr = new_c->mount_opts.compr;
>+ }
>+ if (new_c->mount_opts.rp_size)
>+ c->mount_opts.rp_size = new_c->mount_opts.rp_size;
>+ mutex_unlock(&c->alloc_sem);
>+}
>+
> static int jffs2_reconfigure(struct fs_context *fc)
> {
> struct super_block *sb = fc->root->d_sb;
>
> sync_filesystem(sb);
>+ jffs2_update_mount_opts(fc);
>+
> return jffs2_do_remount_fs(sb, fc);
> }
>
>--
>2.12.3
>
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
next prev parent reply other threads:[~2020-11-06 2:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-14 6:54 [PATCH 1/2] jffs2: fix ignoring mounting options problem during remounting Zhe Li
2020-10-14 6:54 ` [PATCH 2/2] jffs2: fix can't set rp_size to zero " Zhe Li
2020-11-19 2:50 ` Zhe Li
2020-11-23 8:18 ` Richard Weinberger
2020-11-06 2:30 ` Zhe Li [this message]
2020-11-10 21:34 ` [PATCH 1/2] jffs2: fix ignoring mounting options problem " Richard Weinberger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201106023002.12752-1-lizhe67@huawei.com \
--to=lizhe67@huawei.com \
--cc=chenjie6@huawei.com \
--cc=dwmw2@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=qiuxi1@huawei.com \
--cc=richard@nod.at \
--cc=wangfangpeng1@huawei.com \
--cc=zhongjubin@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).