efivarfs: fix hibernation problem with EFI variables
Get series with b4
b4 am [email protected]Versions newest first
- v1 Latest2 patches 3 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | efivarfs: abstract initial variable creation routinefs/ | +22 | 0 replies | |
| 2/2 | efivarfs: add variable resync after hibernationfs/ fs/ fs/ | +155 | 3 replies |
Reviews trailers per patch
None of the 2 patches has a Reviewed-by or Acked-by.
| Patch | Jon Hunter |
|---|---|
| 1/2 | |
| 2/2 | T-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 0/2] efivarfs: fix hibernation problem with EFI variables
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(-)
Signature · 1 line
2.35.3