]> www.infradead.org Git - users/jedix/linux-maple.git/commit
Merge patch series "power: wire-up filesystem freeze/thaw with suspend/resume"
authorChristian Brauner <brauner@kernel.org>
Thu, 3 Apr 2025 07:24:20 +0000 (09:24 +0200)
committerChristian Brauner <brauner@kernel.org>
Fri, 9 May 2025 10:41:23 +0000 (12:41 +0200)
commit05b158d4fd111492e2fa675ad65bc4b0622c0556
treeb5a76542ad235152d8f2a55f2932aceff7c4436b
parent0de4c4065cad198fe44405d0eac7bc043f5ee2f1
parentef2ed04eba999b13096ace4fafc2e7ed04176950
Merge patch series "power: wire-up filesystem freeze/thaw with suspend/resume"

Christian Brauner <brauner@kernel.org> says:

Now all the pieces are in place to actually allow the power subsystem to
freeze/thaw filesystems during suspend/resume. Filesystems are only
frozen and thawed if the power subsystem does actually own the freeze.

Othwerwise it risks thawing filesystems it didn't own. This could be
done differently be e.g., keeping the filesystems that were actually
frozen on a list and then unfreezing them from that list. This is
disgustingly unclean though and reeks of an ugly hack.

If the filesystem is already frozen by the time we've frozen all
userspace processes we don't care to freeze it again. That's userspace's
job once the process resumes. We only actually freeze filesystems if we
absolutely have to and we ignore other failures to freeze.

We could bubble up errors and fail suspend/resume if the error isn't
EBUSY (aka it's already frozen) but I don't think that this is worth it.
Filesystem freezing during suspend/resume is best-effort. If the user
has 500 ext4 filesystems mounted and 4 fail to freeze for whatever
reason then we simply skip them.

What we have now is already a big improvement and let's see how we fare
with it before making our lives even harder (and uglier) than we have
to.

* patches from https://lore.kernel.org/r/20250402-work-freeze-v2-0-6719a97b52ac@kernel.org:
  kernfs: add warning about implementing freeze/thaw
  power: freeze filesystems during suspend/resume

Link: https://lore.kernel.org/r/20250402-work-freeze-v2-0-6719a97b52ac@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>