Re: [PATCH v5] efivarfs: add nostatfs mount option to skip QueryVariableInfo()
From: Ard Biesheuvel
Date: Tue Oct 06 2026 - 03:13:26 EST
Hello Prashant,
Thanks for respinning this.
On Tue, 6 Oct 2026, at 01:22, Prashant Singh wrote:
> QueryVariableInfo() is an EFI runtime service that, on some firmware,
> takes tens of milliseconds and runs with preemption disabled, stalling
> the CPU that services it (and, on firmware that services it via SMM, all
> CPUs). efivarfs_statfs() calls it (rate-limited since commit b2326338dc68
> ("efivarfs: Rate limit statfs() handler")) to report the variable-store
> used/available capacity, so any statfs(2) -- e.g. every "df" -- can
> inject that stall into unrelated latency-sensitive workloads.
>
> Add a negatable "nostatfs" mount option: with nostatfs, statfs(2) skips
> QueryVariableInfo() and reports zero used/available; with statfs it
> reports the capacity as before. It defaults to nostatfs on
> CONFIG_PREEMPT_RT so real-time kernels do not take the stall out of the
> box, but statfs can be passed there to force reporting back on -- e.g.
> for tools such as fwupd that need the efivars free space to update Secure
> Boot key databases.
>
> The option can also be toggled on a live mount via remount, so reporting
> can be enabled only for the duration of a firmware update without
> unmounting the boot-time efivarfs mount:
>
> mount -o remount,statfs /sys/firmware/efi/efivars # reporting on
> mount -o remount,nostatfs /sys/firmware/efi/efivars # reporting off
>
> A remount that does not specify statfs/nostatfs keeps the current setting.
>
So what happens with uid= /gid= in this case. Do they get reset to the
default or not? And before this patch?