From: Gao Xiang <xiang@kernel.org>
To: Yifan Feng <evanfengff@gmail.com>
Cc: Gao Xiang <xiang@kernel.org>, Chao Yu <chao@kernel.org>,
Yue Hu <zbestahu@gmail.com>, Jingbo Xu <jefflexu@163.com>,
Sandeep Dhavale <dhavale@google.com>,
Hongbo Li <hongbohbli@tencent.com>,
Chunhai Guo <guochunhai@vivo.com>,
linux-erofs@lists.ozlabs.org, linux-kernel@vger.kernel.org,
Ping Li <leeonion.muyu@gmail.com>
Subject: Re: [PATCH] erofs: keep the current mount options on remount
Date: Sat, 5 Dec 2026 23:57:06 +0100 [thread overview]
Message-ID: <axSWwg7k4zRkRgTT@MacBookPro.fritz.box> (raw)
In-Reply-To: <20261205023557.74104-1-evanfengff@gmail.com>
On Fri, Dec 04, 2026 at 06:35:57PM -0800, Yifan Feng wrote:
> erofs_init_fs_context() fills every new context with the default
> options, and erofs_fc_reconfigure() installs them as they are. So a
> remount that does not repeat nouser_xattr, noacl, cache_strategy= and
> the other options kept in struct erofs_mount_opts resets them, and the
> user xattrs that nouser_xattr hid can be read again:
>
> # mount -t erofs -o nouser_xattr,cache_strategy=disabled /dev/vda /mnt
> # findmnt -no OPTIONS /mnt
> ro,relatime,nouser_xattr,acl,cache_strategy=disabled
> # mount -o remount,noatime /dev/vda /mnt
> # findmnt -no OPTIONS /mnt
> ro,noatime,user_xattr,acl,cache_strategy=readaround
>
> mount(8) hides this when it is given the mount point only, because it
> then passes the current options again. Before the conversion to the
> mount API a remount changed only the options that it named.
>
> For a remount, start from the options in use.
>
> Fixes: f57a3fe44995 ("erofs: convert to use the new mount fs_context api")
> Signed-off-by: Yifan Feng <evanfengff@gmail.com>
Reviewed-by: Gao Xiang <xiang@kernel.org>
There was a similar patch but I think your patch is better:
https://lore.kernel.org/r/20261118112523.3824782-1-leeonion.muyu@gmail.com
I will add a Reported-by credit like:
Reported-by: Ping Li <leeonion.muyu@gmail.com>
Btw, although it's not perfect as Sashiko's pointed out (racy remount,
but I don't think anyone really cares), a follow-up patch maybe just
introduce a new opt_mask field so that it can mask off unchanged bits
in .reconfigure() when updating.
Thanks,
Gao Xiang
prev parent reply other threads:[~2026-12-05 22:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-05 2:35 [PATCH] erofs: keep the current mount options on remount Yifan Feng
2026-12-05 22:57 ` Gao Xiang [this message]
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=axSWwg7k4zRkRgTT@MacBookPro.fritz.box \
--to=xiang@kernel.org \
--cc=chao@kernel.org \
--cc=dhavale@google.com \
--cc=evanfengff@gmail.com \
--cc=guochunhai@vivo.com \
--cc=hongbohbli@tencent.com \
--cc=jefflexu@163.com \
--cc=leeonion.muyu@gmail.com \
--cc=linux-erofs@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=zbestahu@gmail.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