efivarfs: automatically update super block flag
authorMasahisa Kojima <masahisa.kojima@linaro.org>
Tue, 7 Nov 2023 05:40:55 +0000 (14:40 +0900)
committerArd Biesheuvel <ardb@kernel.org>
Mon, 11 Dec 2023 10:19:18 +0000 (11:19 +0100)
commit94f7f6182c72ba642c1f20111681f9cc8621c95f
treea469f9da0e5bdfd8416b779c7d908a7ee9fc1e5e
parentc44b6be62e8dd4ee0a308c36a70620613e6fc55f
efivarfs: automatically update super block flag

efivar operation is updated when the tee_stmm_efi module is probed.
tee_stmm_efi module supports SetVariable runtime service, but user needs
to manually remount the efivarfs as RW to enable the write access if the
previous efivar operation does not support SetVariable and efivarfs is
mounted as read-only.

This commit notifies the update of efivar operation to efivarfs
subsystem, then drops SB_RDONLY flag if the efivar operation supports
SetVariable.

Signed-off-by: Masahisa Kojima <masahisa.kojima@linaro.org>
[ardb: use per-superblock instance of the notifier block]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
drivers/firmware/efi/efi.c
drivers/firmware/efi/vars.c
fs/efivarfs/internal.h
fs/efivarfs/super.c
include/linux/efi.h