linux-stable/fs/efivarfs
Heinrich Schuchardt 63565e1cbf efivarfs: fix statfs() on efivarfs
[ Upstream commit 79b83606ab ]

Some firmware (notably U-Boot) provides GetVariable() and
GetNextVariableName() but not QueryVariableInfo().

With commit d86ff3333c ("efivarfs: expose used and total size") the
statfs syscall was broken for such firmware.

If QueryVariableInfo() does not exist or returns EFI_UNSUPPORTED, just
report the file system size as 0 as statfs_simple() previously did.

Fixes: d86ff3333c ("efivarfs: expose used and total size")
Link: https://lore.kernel.org/all/20230910045445.41632-1-heinrich.schuchardt@canonical.com/
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
[ardb: log warning on QueryVariableInfo() failure]
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-09-23 11:14:32 +02:00
..
Kconfig treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
Makefile efi: vars: Move efivar caching layer into efivarfs 2022-06-24 20:40:19 +02:00
file.c efivars: convert to fileattr 2021-04-12 15:04:29 +02:00
inode.c fs: port ->fileattr_set() to pass mnt_idmap 2023-01-19 09:24:27 +01:00
internal.h efi: vars: Move efivar caching layer into efivarfs 2022-06-24 20:40:19 +02:00
super.c efivarfs: fix statfs() on efivarfs 2023-09-23 11:14:32 +02:00
vars.c efi: efivars: Fix variable writes without query_variable_store() 2022-10-21 11:09:40 +02:00