# FUSE interruption: callback counts and backend effects

A callback is not an exactly-once cancellation receipt. In this bounded experiment,
two injected interrupts, or two registrations after one interrupt, invoked the
callback twice for one pending write. An explicitly chosen EINTR reply before
versus after the backend write left different bytes. These are native-library
observations and a controlled counterexample, not a rollback defect.

## Method and evidence

The original C harness sends synthetic protocol 7.31 frames through unmodified
libfuse 3.16.2 and 3.17.4 using fuse_session_process_buf and the custom-I/O API.
Each fresh session has a fresh temporary file initially containing SEED; the
requested four-byte backend write changes it to DONE. Callback code only records
notification. The harness selects when the backend operation and reply occur.

Twelve designed scenarios x two versions x two harness compiler modes x three
repetitions = 144 case executions. There are 12 scenarios, not 144 independent
samples. No failure probability or confidence interval is estimated.
observations.json preserves the 2026-11-29 run with 24 version-specific rows,
event traces, 12 run receipts, environment and source/binary hashes. A separate
2026-11-30 replay matched every normalized row. replay.json retains that receipt.

## Results and interpretation

Two injected interrupts produced two callbacks and one backend write.
Registering twice after an interrupt produced two callbacks inside registration.
Unregistering prevented callback delivery but did not reset the interrupted flag.
The before-write and after-write EINTR policies left SEED and DONE respectively.
The harness deliberately chose these policies; libfuse did not implement rollback.

Replies retain identities: an EAGAIN control reply is not the original write's
reply. The unknown-target and completed-request cases use later dispatch to drive
deferred control responses; no responses were delivered to a kernel.

Engineering inference: initialize state before registration, guard non-idempotent
cancellation actions and reconcile backend effects separately from notification.
This advice is an inference from the tested schedules, not measured production
reliability.

## Scope

No filesystem was mounted and no kernel signal delivery was exercised. No
concurrent callbacks, callback-triggered request freeing, deadlock, production
daemon, connection abort, latency or crash durability was tested. No fsync was
issued. DONE describes bytes read back in the process, not survival of power loss.
The FAST 2017 benchmark was reviewed for context, not reproduced.

## Reproduce

Download all files listed in manifest.json into one directory. Follow
reproduction.md. The pinned upstream archives are fetched separately; no upstream
source or library binaries are redistributed here. run.py verifies every regular
upstream source file before replay and records actual compiler/linkage receipts.
verify.py checks evidence; test_verify.py includes mutation rejection controls.

- [Human analysis](https://hesela.com/analyses/fuse-writeback-cache-fsync/#native-interrupt)
- [Stable term](https://hesela.dev/terms/fuse-interrupt/)
- [Observations](observations.json)
- [Typed claim map](claims.json)
- [Harness](harness.c)
- [Runner](run.py)
- [Verifier](verify.py)
- [Verifier tests](test_verify.py)
- [Reproduction commands](reproduction.md)
- [Manifest with SHA-256 hashes](manifest.json)

## Primary sources

- [Linux v6.12 interruption protocol](https://www.kernel.org/doc/html/v6.12/filesystems/fuse.html#interrupting-filesystem-operations)
- [libfuse 3.16.2 callback API](https://github.com/libfuse/libfuse/blob/fuse-3.16.2/include/fuse_lowlevel.h#L1888-L1900)
- [libfuse 3.16.2 registration](https://github.com/libfuse/libfuse/blob/fuse-3.16.2/lib/fuse_lowlevel.c#L2539-L2551)
- [libfuse 3.17.4 registration](https://github.com/libfuse/libfuse/blob/fuse-3.17.4/lib/fuse_lowlevel.c#L2723-L2735)
- [Vangoor, Tarasov and Zadok, FAST 2017](https://www.usenix.org/system/files/conference/fast17/fast17-vangoor.pdf), pp. 59-72. Section 2.2 supplies historical request-identity context; it is not evidence for the tested libfuse 3.x callback counts.
