From: Prashant Singh <singhpra@juniper.net>
To: <ardb@kernel.org>, <jk@ozlabs.org>
Cc: Prashant Singh <singhpra@juniper.net>,
Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
Clark Williams <clrkwllms@kernel.org>,
"Steven Rostedt" <rostedt@goodmis.org>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
"Luis Claudio R . Goncalves" <lgoncalv@redhat.com>,
Steve McIntyre <93sam@debian.org>, <linux-efi@vger.kernel.org>,
<linux-kernel@vger.kernel.org>, <linux-doc@vger.kernel.org>,
<linux-rt-devel@lists.linux.dev>
Subject: Re: [PATCH v3] efivarfs: add nostatfs mount option to skip QueryVariableInfo()
Date: Mon, 28 Sep 2026 13:21:11 -0700 [thread overview]
Message-ID: <20260928202111.70491-1-singhpra@juniper.net> (raw)
In-Reply-To: <17ae71e4-c044-4354-938e-3e8021615e6d@app.fastmail.com>
Hi Ard,
Thanks for the review. v4 addresses all three points:
On Fri, 25 Sep 2026, at 14:14, Ard Biesheuvel wrote:
> > - Read/write nostatfs with READ_ONCE()/WRITE_ONCE(): statfs() reads it
> > without s_umount while remount can update it.
>
> Why? There is no memory ordering or tearing issue here, but only a
> fundamental race where a remount and a statfs() might occur at the
> same time.
That's right -- a concurrent remount and statfs() is the only case, and
it's benign (no ordering or tearing for a bool). I've dropped that
changelog bullet. I kept READ_ONCE()/WRITE_ONCE() only to mark the
intentional unlocked access for KCSAN, but I'm happy to drop them if you'd
prefer.
> > + if (opts->nostatfs)
> > + seq_puts(m, ",nostatfs");
> > + else if (IS_ENABLED(CONFIG_PREEMPT_RT))
> > + seq_puts(m, ",statfs");
>
> Please drop this else branch - it should be sufficient for the 'nostatfs'
> to disappear from the mount options to understand what is going on.
Dropped in v4. Only ",nostatfs" is shown; its absence means reporting is on.
> > + if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE) {
> > + sfi->mount_opts.uid = old->mount_opts.uid;
> > + sfi->mount_opts.gid = old->mount_opts.gid;
>
> Why do we need this? Does remount otherwise forget its options? Does this
> mean that before this patch, remounting with only a different gid would
> reset the uid specified at mount time to the default? If so, please fix
> that in a separate (preceding) patch.
No reset bug. efivarfs_reconfigure() only writes nostatfs back to the live
sb, never uid/gid, so a remount leaves uid/gid at their mount-time values
(verified on a PREEMPT_RT box: uid=1000 survives "remount,gid=2000", gid
ignored). The uid/gid copies were therefore dead code -- removed. The
branch now only preserves nostatfs, the one option remount can actually
change.
Thanks,
Prashant
prev parent reply other threads:[~2026-09-28 20:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 11:31 Prashant Singh
2026-09-25 11:45 ` sashiko-bot
2026-09-25 12:14 ` Ard Biesheuvel
2026-09-28 20:21 ` Prashant Singh [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=20260928202111.70491-1-singhpra@juniper.net \
--to=singhpra@juniper.net \
--cc=93sam@debian.org \
--cc=ardb@kernel.org \
--cc=bigeasy@linutronix.de \
--cc=clrkwllms@kernel.org \
--cc=corbet@lwn.net \
--cc=jk@ozlabs.org \
--cc=lgoncalv@redhat.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rt-devel@lists.linux.dev \
--cc=rdunlap@infradead.org \
--cc=rostedt@goodmis.org \
--cc=skhan@linuxfoundation.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
all inboxes | Powered by JetHome®