[RFC PATCH 0/4] vfs freeze/thaw on suspend/resume

From: James Bottomley
Date: Thu Mar 27 2025 - 10:15:35 EST


This sequence is posted as an RFC because it needs to be combined with
Luis' patch set:

https://lore.kernel.org/linux-fsdevel/20250326112220.1988619-1-mcgrof@xxxxxxxxxx/

In particular I've done nothing to replace the kthread freezing in
filesystems. I can say that this works flawlessly on 6.14 with my
limited test rig (I only have access to my laptop while at LSF/MM).
My test VM is ext4 root with a file on the root attached to a loop
device and mounted (to test nesting) while running a fio workload on
the upper ext4.

The rwsem rework is absolutely necessary because without it hibernate
immediately fails because systemd-journald tries to record the kernel
messages and gets blocked in sb_start_write() on TASK_INTERRUPTIBLE
which inhibits hibernation.

My goal in doing this is to be able to add a thaw_super() callback to
efivarfs and remove our deadlock prone pm notifier.

Regards,

James

---

James Bottomley (4):
locking/percpu-rwsem: add freezable alternative to down_read
vfs: make sb_start_write freezable
fs/super.c: introduce reverse superblock iterator and use it in
emergency remount
vfs: add filesystem freeze/thaw callbacks for power management

fs/super.c | 109 ++++++++++++++++++++++++++++------
include/linux/fs.h | 8 ++-
include/linux/percpu-rwsem.h | 20 +++++--
kernel/locking/percpu-rwsem.c | 13 ++--
kernel/power/hibernate.c | 12 ++++
kernel/power/suspend.c | 4 ++
6 files changed, 137 insertions(+), 29 deletions(-)

--
2.43.0