public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET V4 2/2] fs: send uevents on mount and unmount
@ 2025-12-18  2:02 Darrick J. Wong
  2025-12-18  2:04 ` [PATCH 1/4] fs: send uevents for filesystem mount events Darrick J. Wong
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Darrick J. Wong @ 2025-12-18  2:02 UTC (permalink / raw)
  To: brauner, djwong; +Cc: linux-ext4, linux-xfs, hch, linux-fsdevel

Hi all,

To support a self healing filesystem, we need a way to autostart the
xfs_healer userspace daemon as soon as a filesystem mounts.  Since XFS
actually creates a file in the sysfs namespace, the kernel can emit
a uevent for that sysfs file when the filesystem mounts.  In turn, udev
will process the uevent according to the uevent rules, which means that
we have an easy way to start the background service.

This short series adds some common code to emit filesystem uevents and
teaches xfs to take advantage of it.  Unfortunately this isn't a fully
generic solution because not all filesystems actually create kobjects
for themselves.

This is also a prerequisite for the XFS self-healing V4 series which
will come at a later time.

If you're going to start using this code, I strongly recommend pulling
from my git trees, which are linked below.

This has been running on the djcloud for months with no problems.  Enjoy!
Comments and questions are, as always, welcome.

--D

kernel git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfs-linux.git/log/?h=filesystem-uevents

fstests git tree:
https://git.kernel.org/cgit/linux/kernel/git/djwong/xfstests-dev.git/log/?h=filesystem-uevents
---
Commits in this patchset:
 * fs: send uevents for filesystem mount events
 * xfs: send uevents when major filesystem events happen
 * ext4: convert ext4_root to a kset
 * ext4: send uevents when major filesystem events happen
---
 include/linux/fsevent.h |   33 ++++++++++++
 fs/Makefile             |    2 -
 fs/ext4/ioctl.c         |    2 +
 fs/ext4/super.c         |    6 ++
 fs/ext4/sysfs.c         |   22 +++++---
 fs/fsevent.c            |  128 +++++++++++++++++++++++++++++++++++++++++++++++
 fs/xfs/xfs_fsops.c      |    2 +
 fs/xfs/xfs_super.c      |   10 ++++
 8 files changed, 195 insertions(+), 10 deletions(-)
 create mode 100644 include/linux/fsevent.h
 create mode 100644 fs/fsevent.c


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

end of thread, other threads:[~2026-01-05 17:26 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-18  2:02 [PATCHSET V4 2/2] fs: send uevents on mount and unmount Darrick J. Wong
2025-12-18  2:04 ` [PATCH 1/4] fs: send uevents for filesystem mount events Darrick J. Wong
2025-12-18  5:26   ` Christoph Hellwig
2025-12-18 19:49     ` Darrick J. Wong
2025-12-18 23:33   ` [PATCH V4.1 " Darrick J. Wong
2025-12-24 12:47   ` [PATCH " Christian Brauner
2025-12-26 23:58     ` Ian Kent
2026-01-05 17:26       ` Darrick J. Wong
2026-01-05 17:25     ` Darrick J. Wong
2025-12-18  2:04 ` [PATCH 2/4] xfs: send uevents when major filesystem events happen Darrick J. Wong
2025-12-18  5:27   ` Christoph Hellwig
2025-12-18  2:05 ` [PATCH 3/4] ext4: convert ext4_root to a kset Darrick J. Wong
2025-12-18  5:27   ` Christoph Hellwig
2025-12-18  2:05 ` [PATCH 4/4] ext4: send uevents when major filesystem events happen Darrick J. Wong
2025-12-18  5:27   ` Christoph Hellwig

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