From 4f65855f372186406f4e48708ec3d5eb9aceb6d3 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Wed, 30 Sep 2026 22:51:17 -0300 Subject: log stats 0, and pardes re-pins cloud9 whose 9ns opens such a file direct and nonseekable: fs.md's follow recipe with cat works through a mount The log stated the length an open would freeze, a length a mount's kernel could take as its end, and a splicing cat read it from the kernel's offset. log now stats 0, as the other streams and generated views do, and the re-pinned cloud9's 9ns opens any file stating 0 FOPEN_DIRECT_IO | FOPEN_NONSEEKABLE. A look at such a file (the mounted index) reads a regular file that will not seek as a stream rather than refusing it as a pipe. selfmount runs the recipe, exec 3<>log; echo follow >&3; cat <&3, through the mount and hears a record made after it started. Co-Authored-By: Claude Opus 5.5 --- test/selfmount.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'test') diff --git a/test/selfmount.py b/test/selfmount.py index 86c32fa8..dd59083c 100644 --- a/test/selfmount.py +++ b/test/selfmount.py @@ -176,6 +176,16 @@ def run(binary): held = run(f"for i in $(seq 40); do cat {mount}/pane/{first}/event > /dev/null & done; " f"sleep 1; timeout 10 cat {mount}/layout > /dev/null; st=$?; kill $(jobs -p); exit $st\n".encode()) check(held == '0', f'cat layout answers beside 40 held event reads ({held!r})') + # fs.md's follow recipe, as written, with plain cat, its output + # a pipe (where coreutils cat splices): it hears a record made + # after it started. + recipe = Path(f'/tmp/{name}.follow') + ran = run(f"exec 3<>{mount}/log; echo follow >&3; " + f"(sleep 1; echo 'Msg recipe-heard' > {mount}/exec) & " + f"timeout 5 cat <&3 | cat > {recipe}; exit 0\n".encode()) + followed = recipe.read_text() if recipe.exists() else '' + recipe.unlink(missing_ok=True) + check(ran == '0' and 'recipe-heard' in followed, f'the log follow recipe with cat hears a new record ({followed[-120:]!r})') client.write('/exec', b'Msg still here\n') text = ''.join(cell[0] for cell in client.screen()['cells']) check('still here' in text, 'the editor answers after all of that') -- cgit v1.3