From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: linux-fsdevel@vger.kernel.org, linux-efi@vger.kernel.org,
linux-pm@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>, Jeremy Kerr <jk@ozlabs.org>,
Christian Brauner <brauner@kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Lennart Poettering <mzxreary@0pointer.de>
Subject: [PATCH 0/2] efivarfs: fix hibernation problem with EFI variables
Date: Tue, 7 Jan 2025 13:31:27 -0800 [thread overview]
Message-ID: <20250107213129.28454-1-James.Bottomley@HansenPartnership.com> (raw)
I've cc'd both fsdevel and linux-pm on this because no other
filesystem actually has a hook for hibernation so I need people to
think whether the way I've done it (adding a direct PM hook per
superblock) is the right way and then whether the mechanism is the
best one for addressing the problem.
Problem statement: efivarfs is a pseudo filesystem that is used to
interact with the EFI variables. After the system is booted, the only
way to retrieve and update variables is via the UEFI Runtime Variable
Services, which are mediated by efivarfs, so it caches the state of
the variables (existence and size) in a dentry tree that ls can see.
However, on hibernation the variables may get altered either by other
operating systems or directly in UEFI setup. This means that on
hibernation restore, the dentry cache may be out of sync and thus
should be updated. The added PM_POST_HIBERNATION hook brings the
dentry tree back into sync again.
The first patch abstracts variable creation so it can be reused from
the second patch which, on resume from hibernation, firstly loops over
all the dentries and deletes those which don't exist in the UEFI
variable store and then loops over the variable store creating
dentries for ones that don't exist.
Regards,
James
---
James Bottomley (2):
efivarfs: abstract initial variable creation routine
efivarfs: add variable resync after hibernation
fs/efivarfs/internal.h | 3 +-
fs/efivarfs/super.c | 187 +++++++++++++++++++++++++++++++++++++----
fs/efivarfs/vars.c | 5 +-
3 files changed, 177 insertions(+), 18 deletions(-)
--
2.35.3
next reply other threads:[~2025-01-07 21:31 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-07 21:31 James Bottomley [this message]
2025-01-07 21:31 ` [PATCH 1/2] efivarfs: abstract initial variable creation routine James Bottomley
2025-01-07 21:31 ` [PATCH 2/2] efivarfs: add variable resync after hibernation James Bottomley
2025-02-28 16:44 ` Jon Hunter
2025-02-28 16:49 ` James Bottomley
2025-02-28 17:53 ` Jon Hunter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250107213129.28454-1-James.Bottomley@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=ardb@kernel.org \
--cc=brauner@kernel.org \
--cc=jk@ozlabs.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mzxreary@0pointer.de \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox