1 Commits

Author SHA1 Message Date
William Gill
5730d95892 v1.29-notify-1: patches for scoutfs v1.29
Backport of the three notify patches onto scoutfs v1.29 as its own
long-lived branch.  Rebase was clean: v1.29 -> v1.30 touches
btree/forest/quota/totl/triggers/wkic/xattr, none of which our
patches modify, so the three commits apply unchanged.

Branch purpose: scoutfs-build's multi-version pipeline checks out
this branch (via SCOUTFS_NOTIFY_REF=v1.29-notify-1) when building
kmod RPMs for scoutfs v1.29.  Each currently-supported scoutfs
version has its own branch in this repo.
2026-04-23 08:59:34 -05:00
5 changed files with 39 additions and 48 deletions

View File

@@ -2,12 +2,12 @@
Observer-only file access notifications for [ScoutFS](https://github.com/versity/scoutfs),
distributed as a rebasable `git format-patch` series plus a small Go
userspace relay daemon. Maintained as one long-lived branch per
currently-supported upstream scoutfs version.
userspace relay daemon. Layers onto each upstream release with minimal
maintenance.
## What the series adds
Three patches against each supported scoutfs release:
Three patches against the scoutfs source tree:
1. **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
@@ -25,67 +25,58 @@ Three patches against each supported scoutfs release:
clients. Pure-stdlib Go; no external module dependencies. Shipped
with a systemd template unit `scoutfs-notifyd@<mountpoint>.service`.
The notify ABI (`SCOUTFS_IOC_READ_NOTIFY` nr 25, 64-byte event record) is
identical across all three supported scoutfs versions, so consumers and
the daemon do not need per-version branching in their own code.
## Base
## Repository layout
Currently rebased against:
Each supported scoutfs version lives on its own long-lived branch. The
patches in each branch are tuned for that specific scoutfs tree; they do
NOT apply cross-version without rebasing.
scoutfs v1.30
| Branch | Targets scoutfs | Tag |
|----------------|-----------------|------------------|
| `v1.28` | `v1.28` | `v1.28-notify-1` |
| `v1.29` | `v1.29` | `v1.29-notify-1` |
| `main` / `v1.30` | `v1.30` | `v1.30-notify-1` |
See [base.txt](./base.txt).
`main` tracks the newest supported scoutfs version. When a new scoutfs
release ships, a new branch is created and the patches are rebased onto
it; when a scoutfs version ages out of support, its branch stays in the
repo for historical builds but is no longer maintained.
## Build dependencies added
On top of the stock scoutfs build requirements, patch 3 adds:
* `golang >= 1.26` on 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
Against a scoutfs git working tree at the matching upstream tag:
```sh
git clone -b v1.29 https://git.anomalous.dev/alphacentri/scoutfs-notify.git /tmp/notify
/tmp/notify/apply.sh /path/to/scoutfs-v1.29-checkout
./apply.sh /path/to/scoutfs
```
The script runs `git am --3way` on each patch in order.
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
```sh
# In a fresh scoutfs checkout:
git checkout v1.31
git checkout -b notify-v1.31
# Apply the previous branch's patches (usually clean; resolve any
# conflicts, git am --continue).
git am --3way /path/to/scoutfs-notify-v1.30/patches/*.patch
git format-patch v1.31..notify-v1.31 -o /tmp/new-patches/
# Push a new branch + tag in this repo:
cd /path/to/scoutfs-notify
git checkout -b v1.31 main
rm patches/*.patch
cp /tmp/new-patches/*.patch patches/
echo v1.31 > base.txt
git commit -am 'v1.31-notify-1: rebase onto scoutfs v1.31'
git push -u origin v1.31
git tag v1.31-notify-1 && git push origin v1.31-notify-1
# Fast-forward main to the new tip once you're ready to promote it.
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
```sh
systemctl enable --now scoutfs-notifyd@mnt-scoutfs.service
FSID=$(scoutfs stat /mnt/scoutfs | awk '/fsid/ { print $2 }')
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
```

View File

@@ -1 +1 @@
v1.30
v1.29

View File

@@ -1,4 +1,4 @@
From 6c5b791d47079df892ee25e6f17c22da2f643340 Mon Sep 17 00:00:00 2001
From 01ff9e270c2ef3818abdf6034d2bd090aec4f4a7 Mon Sep 17 00:00:00 2001
From: William Gill <claude@williamgill.net>
Date: Wed, 22 Apr 2026 14:38:51 -0500
Subject: [PATCH 1/3] notify: core file-access notification infrastructure

View File

@@ -1,4 +1,4 @@
From 496b47ab6dab052baecdfbabb0c92649a89d65b4 Mon Sep 17 00:00:00 2001
From f4abcb49aa3477fc654a435798e5e9efeea44e12 Mon Sep 17 00:00:00 2001
From: William Gill <claude@williamgill.net>
Date: Wed, 22 Apr 2026 14:40:04 -0500
Subject: [PATCH 2/3] notify: file open/read hook sites

View File

@@ -1,4 +1,4 @@
From b6cbfc46485cb9b7f5e87d0ff451f81c25d7d41c Mon Sep 17 00:00:00 2001
From c2793743cdc635f54edb1ed2a8020a9f1ca47315 Mon Sep 17 00:00:00 2001
From: William Gill <claude@williamgill.net>
Date: Wed, 22 Apr 2026 14:40:34 -0500
Subject: [PATCH 3/3] notify: scoutfs-notifyd userspace relay daemon (Go 1.26)