[PATCH v3 0/4] gfs2: protect sysfs callbacks from superblock teardown

From: Jiacheng Xu

Date: Sun Sep 20 2026 - 04:31:50 EST


The GFS2 sysfs files become visible before fill_super() completes and
remain present during filesystem teardown. Protect quota refresh,
statfs sync, quota sync and demote requests with a non-blocking read
lock on s_umount, and require SB_ACTIVE before accessing their state.

Changes in v3:
- Rebase onto 518e5b794c06c0f0eb40df3e202274a66202c137.
- Introduce super_trylock_shared_active() and super_unlock_active().
- Move quota refresh locking into the user and group sysfs callbacks.
- Use the shared helpers in statfs_sync, quota_sync and demote_rq.
- Drop the status patch as requested by Andreas, in favor of his separate
fix: https://lore.kernel.org/gfs2/20260827190632.686583-1-agruenba@xxxxxxxxxx/

Previous version:
https://lore.kernel.org/all/6a91508.162bd.1a0228251e8.Coremail.stitch@xxxxxxxxxx/

Jiacheng Xu (4):
gfs2: protect quota refresh from superblock teardown
gfs2: protect statfs sync sysfs callback
gfs2: protect quota sync sysfs callback
gfs2: protect demote requests during superblock teardown

fs/gfs2/sys.c | 60 +++++++++++++++++++++++++++++++++++++++++++++++----
1 file changed, 56 insertions(+), 4 deletions(-)


base-commit: 518e5b794c06c0f0eb40df3e202274a66202c137
--
2.51.0