Re: [PATCH v3] efivarfs: add nostatfs mount option to skip QueryVariableInfo()

From: Prashant Singh

Date: Mon Sep 28 2026 - 16:22:51 EST


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