mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/5] super: rework super_lock()
@ 2026-10-23  9:41 Christian Brauner
  2026-10-23  9:41 ` [PATCH 1/5] super: add super_wait() Christian Brauner
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: Christian Brauner @ 2026-10-23  9:41 UTC (permalink / raw)
  To: Jan Kara
  Cc: Alexander Viro, Josef Bacik, linux-fsdevel, linux-kernel,
	Christian Brauner (Amutable)

Josef's two series (cf. [1], [2]) left us with four ways to lock a
superblock and two ways to wait for one that's being shut down.
super_lock(), super_lock_shared() and super_lock_excl() return true on
success while super_lock_killable() returns 0. And callers that need an
unmount to be over pair super_lock() with super_wait_shutdown() or
super_wait_shutdown_killable() and have to pick the one that matches
the lock they took. Jan pointed out the bool vs int mess (cf. [3]).

So fold it all into a single super_lock() that takes SUPER_LOCK_EXCL,
SUPER_LOCK_KILLABLE and SUPER_LOCK_WAIT_SHUTDOWN and returns 0 with
s_umount held or a negative error code. The first three patches don't
change behavior.

The fourth patch makes sync(2) killable while it waits for s_umount of
a live superblock. Right now a freeze or remount that's stuck under
s_umount hangs every sync(2) on the machine and nobody can kill it.
fs_bdev_sync() already works that way.

The last patch adds a guard for super_lock() for the callers that take
and drop s_umount in the same scope.

This sits on top of vfs-7.5.super which carries Josef's series.

[1]: https://lore.kernel.org/20261021-b4-super-lock-dying-v1-0-2b35e86706ff@toxicpanda.com
[2]: https://lore.kernel.org/20261021-b4-super-lock-unborn-v1-0-0265eddb6dee@toxicpanda.com
[3]: https://lore.kernel.org/tmw22jj2hn6g6lklme2j3rsfjvmstzpoicvibvmmv6sivd66oj@nhc4lng25gti

Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
---
Christian Brauner (5):
      super: add super_wait()
      super: let super_lock() take flags
      super: let super_lock() wait for a superblock being shut down
      super: make sync(2)'s wait for s_umount killable
      super: add a guard for super_lock()

 fs/super.c | 340 ++++++++++++++++++++++++++++---------------------------------
 1 file changed, 156 insertions(+), 184 deletions(-)
---
base-commit: e6d8f4efc8e2301e15de7bcf9e8d3a2134fb058a
change-id: 20261023-work-super-lock_helpers-23d8d257c1b4


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-10-23 13:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-23  9:41 [PATCH 0/5] super: rework super_lock() Christian Brauner
2026-10-23  9:41 ` [PATCH 1/5] super: add super_wait() Christian Brauner
2026-10-23  9:41 ` [PATCH 2/5] super: let super_lock() take flags Christian Brauner
2026-10-23  9:41 ` [PATCH 3/5] super: let super_lock() wait for a superblock being shut down Christian Brauner
2026-10-23  9:41 ` [PATCH 4/5] super: make sync(2)'s wait for s_umount killable Christian Brauner
2026-10-23  9:41 ` [PATCH 5/5] super: add a guard for super_lock() Christian Brauner
2026-10-23 13:54 ` [PATCH 0/5] super: rework super_lock() Josef Bacik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®