94a4fd53c662cd354fd81fe787236978e7c9e7d3
Reworks the series to Option B from the design discussion: no mount options, no sysfs toggles, single well-known socket per scoutfs volume at /run/scoutfs/<fsid>/notify.sock. Changes vs v1.29-notify-1: - Kmod: dropped notify_events / notify_ring_kb mount options and their sysfs attrs. Ring is always allocated at mount with a compile-time 64 KiB size. notify_enabled is now flipped by the ioctl handler on reader attach / detach, so emit hooks are zero-cost unless a watcher is connected. - New third patch: scoutfs-notifyd userspace relay. Single-threaded epoll daemon that drains the ioctl and broadcasts each record as a SOCK_SEQPACKET message to connected clients. Shipped with a systemd template unit and man page. - Packaging: utils/Makefile and scoutfs-utils.spec.in install the daemon at /usr/sbin/scoutfs-notifyd and the unit at /usr/lib/systemd/system/scoutfs-notifyd@.service. Patches 1 and 2 have been re-scoped; re-apply expected to succeed on scoutfs v1.29.
scoutfs-notify
Observer-only file access notifications for ScoutFS,
distributed as a rebasable git format-patch series plus a small userspace
relay daemon. Layers onto each upstream release with minimal maintenance.
What the series adds
Three patches against the scoutfs source tree:
- Kmod core — a per-mount 64 KiB ring of 64-byte notification records and
a single-reader drain ioctl (
SCOUTFS_IOC_READ_NOTIFY, nr 25). Emit is non-blocking, drop-on-full; the monotonicseqfield exposes drops to consumers. Three percpu counters (notify_emitted,notify_dropped_ring_full,notify_reader_attached). No mount option, no sysfs toggle. - Kmod hooks —
->openwrapper and READ emit inscoutfs_file_aio_read/scoutfs_file_read_iter. Every hook is a single predicted-false branch when no reader is attached. Nothing in the data-waiter state machine is touched. - scoutfs-notifyd — userspace daemon that binds
/run/scoutfs/<fsid>/notify.sock(AF_UNIX SOCK_SEQPACKET, mode 0600, root-only), drains the ring, and broadcasts each record to connected clients. Shipped with a systemd template unitscoutfs-notifyd@<mountpoint>.service.
Base
Currently rebased against:
scoutfs v1.29
See base.txt.
Applying
./apply.sh /path/to/scoutfs
Runs git am --3way on each patch. For a tarball instead of a git tree,
use patch -p1 in a loop (see script).
Rebasing onto a new upstream release
git fetch --tags
git checkout -B notify v1.30
git am --3way patches/*.patch
# resolve any conflicts, git am --continue
git format-patch v1.30..notify -o patches/
# update base.txt and commit
Tag pinning
Each release of this patch set is tagged as v<upstream>-notify-<rev>:
v1.29-notify-1 (retired — included mount options)
v1.29-notify-2 (current — daemon-driven, no knobs)
Quick smoke test after installation
systemctl enable --now scoutfs-notifyd@mnt-scoutfs.service
socat - UNIX-CONNECT:/run/scoutfs/$(stat -c %d /mnt/scoutfs)/notify.sock \
| xxd | head # watch events stream as you touch files
Languages
Shell
100%