From: Christian Brauner <brauner@kernel.org>
To: Mike Yuan <me@yhndnzj.com>
Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org,
Luis Chamberlain <mcgrof@kernel.org>,
Hugh Dickins <hughd@google.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] shmem: fix tmpfs reconfiguration (remount) when noswap is set
Date: Wed, 12 Nov 2025 10:33:46 +0100 [thread overview]
Message-ID: <20251112-vorbehalt-heizsysteme-3b11ba2b7ea3@brauner> (raw)
In-Reply-To: <20251108190930.440685-1-me@yhndnzj.com>
On Sat, Nov 08, 2025 at 07:09:47PM +0000, Mike Yuan wrote:
> In systemd we're trying to switch the internal credentials setup logic
> to new mount API [1], and I noticed fsconfig(FSCONFIG_CMD_RECONFIGURE)
> consistently fails on tmpfs with noswap option. This can be trivially
> reproduced with the following:
>
> ```
> int fs_fd = fsopen("tmpfs", 0);
> fsconfig(fs_fd, FSCONFIG_SET_FLAG, "noswap", NULL, 0);
> fsconfig(fs_fd, FSCONFIG_CMD_CREATE, NULL, NULL, 0);
> fsmount(fs_fd, 0, 0);
> fsconfig(fs_fd, FSCONFIG_CMD_RECONFIGURE, NULL, NULL, 0); <------ EINVAL
> ```
>
> After some digging the culprit is shmem_reconfigure() rejecting
> !(ctx->seen & SHMEM_SEEN_NOSWAP) && sbinfo->noswap, which is bogus
> as ctx->seen serves as a mask for whether certain options are touched
> at all. On top of that, noswap option doesn't use fsparam_flag_no,
> hence it's not really possible to "reenable" swap to begin with.
> Drop the check and redundant SHMEM_SEEN_NOSWAP flag.
>
> [1] https://github.com/systemd/systemd/pull/39637
>
> Fixes: 2c6efe9cf2d7 ("shmem: add support to ignore swap")
> Signed-off-by: Mike Yuan <me@yhndnzj.com>
> Cc: Luis Chamberlain <mcgrof@kernel.org>
> Cc: Christian Brauner <brauner@kernel.org>
> Cc: Hugh Dickins <hughd@google.com>
> Cc: <stable@vger.kernel.org>
> ---
Reviewed-by: Christian Brauner <brauner@kernel.org>
next prev parent reply other threads:[~2025-11-12 9:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-08 19:09 Mike Yuan
2025-11-12 9:33 ` Christian Brauner [this message]
2025-11-12 11:44 ` David Hildenbrand (Red Hat)
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=20251112-vorbehalt-heizsysteme-3b11ba2b7ea3@brauner \
--to=brauner@kernel.org \
--cc=hughd@google.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mcgrof@kernel.org \
--cc=me@yhndnzj.com \
--cc=stable@vger.kernel.org \
/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