Backport of the three notify patches onto scoutfs v1.28. v1.28
predates SCOUTFS_IOC_PUNCH_OFFLINE (nr 24, introduced in v1.29),
so two trivial hunk fixes were needed during rebase:
kmod/src/ioctl.h:
drop the PUNCH_OFFLINE struct + define from the notify patch's
context, since the surrounding definition doesn't exist in v1.28.
Our SCOUTFS_IOC_READ_NOTIFY stays at nr 25 — Linux ioctl numbers
are sparse and don't require the predecessor.
kmod/src/ioctl.c:
drop the PUNCH_OFFLINE dispatch case from the context for the
same reason.
Resulting ABI is identical to v1.29-notify-1 and v1.30-notify-1:
SCOUTFS_IOC_READ_NOTIFY is nr 25 on all three, so scoutfs-notifyd
and any third-party consumer need zero per-version branching.
Branch purpose: scoutfs-build's multi-version pipeline checks out
this branch (via SCOUTFS_NOTIFY_REF=v1.28-notify-1) when building
kmod RPMs for scoutfs v1.28.
scoutfs-notify
Observer-only file access notifications for ScoutFS,
distributed as a rebasable git format-patch series plus a small Go
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 (Go) — 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. Pure-stdlib Go; no external module dependencies. Shipped with a systemd template unitscoutfs-notifyd@<mountpoint>.service.
Base
Currently rebased against:
scoutfs v1.30
See base.txt.
Build dependencies added
On top of the stock scoutfs build requirements, patch 3 adds:
golang >= 1.26on the build host (fetched from go.dev by the CI; no distro currently packages 1.26).
The Go build is offline (GOPROXY=off) — no network access required at
build time. CGO_ENABLED=0 so the produced binary is a pure-Go static
ELF.
Applying
./apply.sh /path/to/scoutfs
Runs git am --3way on each patch. For a tarball instead of a git tree,
loop patch -p1 < patches/*.patch.
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 history
v1.30-notify-1 (current — rebased onto scoutfs v1.30, no code changes)
v1.29-notify-4 (retired — last v1.29-base release) v1.29-notify-3 (retired — Go 1.21 toolchain) v1.29-notify-2 (retired — C daemon; had latent ring-size compile bug) v1.29-notify-1 (retired — shipped mount options)
Quick smoke test after installation
systemctl enable --now scoutfs-notifyd@mnt-scoutfs.service
FSID=$(stat -f -c %i /mnt/scoutfs) # or use your scoutfs cli
socat - UNIX-CONNECT:/run/scoutfs/${FSID}/notify.sock | xxd | head
# touch some files in /mnt/scoutfs in another terminal