efivarfs: support freeze/thaw
authorChristian Brauner <brauner@kernel.org>
Mon, 31 Mar 2025 12:42:12 +0000 (14:42 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 9 May 2025 10:41:23 +0000 (12:41 +0200)
commit0e4f9483959b785f65a36120bb0e4cf1407e492c
tree9aa599a87ba8833f4240b96cc010947762eb9221
parent33445d6fc5206ef7fad185704bf241a9e9c3b2b9
efivarfs: support freeze/thaw

Allow efivarfs to partake to resync variable state during system
hibernation and suspend. Add freeze/thaw support.

This is a pretty straightforward implementation. We simply add regular
freeze/thaw support for both userspace and the kernel. This works
without any big issues and congrats afaict efivars is the first
pseudofilesystem that adds support for filesystem freezing and thawing.

The simplicity comes from the fact that we simply always resync variable
state after efivarfs has been frozen. It doesn't matter whether that's
because of suspend, userspace initiated freeze or hibernation. Efivars
is simple enough that it doesn't matter that we walk all dentries. There
are no directories and there aren't insane amounts of entries and both
freeze/thaw are already heavy-handed operations. We really really don't
need to care.

Link: https://lore.kernel.org/r/20250331-work-freeze-v1-2-6dfbe8253b9f@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/efivarfs/internal.h
fs/efivarfs/super.c