Skip to content

fuse: SIGBUS a DLM fault on an aborted connection instead of retrying - #253

Merged
hbirth merged 1 commit into
DDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1from
cryptosven76:redfs-617-fault-abort-sigbus
Oct 12, 2026
Merged

hbirth merged 1 commit into
DDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1from
cryptosven76:redfs-617-fault-abort-sigbus

Conversation

@cryptosven76

@cryptosven76 cryptosven76 commented Oct 12, 2026 •

Copy link
Copy Markdown

Fixes RED-51342.

With the writeback cache and DLM, the slow path of fuse_filemap_fault() drops the fault lock, does its blocking work, and returns VM_FAULT_RETRY. Errors on that path are ignored. Since 9f312f3, a FAULT_FLAG_TRIED pass takes that path too, so a fault that keeps failing never reaches the blocking path, which is what would turn the error into SIGBUS. On an aborted connection every READ fails, so a task touching a non-resident page of a mapping refaults forever. It burns CPU, only SIGKILL ends it, and its mapping keeps the mount busy.

This was seen on tyan-h3-u24 after the redfsd hang watchdog aborted a hung connection. Four fio mmap jobs ran at 100% system time for over 5 minutes; perf showed them looping through fuse_fault_read_private_folios(). The client agent's umount failed with "target is busy" until they were killed with SIGKILL.

The fix checks fc->connected on the slow path while the fault lock is still held, and returns VM_FAULT_SIGBUS when the connection is gone. Resident pages with a recorded grant still map through the fast path.

Not covered: a persistent error on a live connection, such as a server that fails every READ, still loops. Ending that needs state carried from one retry to the next, and I'd like your view on how to carry it.

Testing

Built as redfs.ko (contrib/redfs.ko src/6.17.0-16.16.ubuntu with this patch) against 6.17.0-42-generic on tyan-h3-u24, with no warnings or errors. Loaded it there and reran the same test: the fio repro of RED-50931 (buffered randrw with fsync, mmap randrw, and O_DIRECT randwrite on the same files), with the redfsd hang watchdog aborting the connection.

Before (stock module) With this patch
fio mmap jobs after the abort 4 jobs at 100% system time for over 5 min, until SIGKILL all 4 died with SIGBUS (got signal=7)
Client agent umount "target is busy", retried every 15–30 s succeeded on the first try, 22 s after the abort
Mount back only after SIGKILL redfsd restarted 33 s after the abort, without intervention

redfs-rhel10_0 carries the same code and needs the same change; it will come in a separate PR.

🤖 Generated with Claude Code

With the writeback cache and DLM, fuse_filemap_fault()'s slow path
drops the fault lock, takes the DLM grant and reads the batch window
into private folios, and returns VM_FAULT_RETRY. Errors on that path
are ignored. Its comment expects a persistent error to end on the
blocking path, which turns it into SIGBUS. Since 9f312f3 ("fuse: drop
fault-around for shared-writable mappings under DLM") a
FAULT_FLAG_TRIED pass takes the drop-and-retry path too, so a retried
fault that keeps failing never gets there. Once the fault lock is
dropped, VM_FAULT_RETRY is the only answer the fault can give.

An aborted connection fails every request, so a task touching a
non-resident page of a mapping on that mount refaults forever. It
spends all its time in the kernel, ignores every signal but SIGKILL,
and its mapping keeps the mount busy, so the mount cannot be unmounted
and recovered. This was seen after the redfsd hang watchdog aborted a
hung connection: four fio mmap jobs ran at 100% CPU for minutes, each
pass allocating and freeing the batch folios in
fuse_fault_read_private_folios(), and the client agent's umount failed
with EBUSY until they were killed.

Check the connection on the slow path while the fault lock is still
held, and return VM_FAULT_SIGBUS when it is gone, which is what a
fault on a non-resident page of an aborted mount returns without DLM.
Resident pages with a recorded grant still map through the fast path.

A persistent error on a live connection, such as a server that fails
every READ, still loops the same way. Ending that needs state carried
from one retry to the next and is left out here.

Signed-off-by: Sven Oehme <soehme@ddn.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@hbirth
hbirth merged commit b47d3db into DDNStorage:redfs-ubuntu-hwe-6.17.0-16.16-24.04.1 Oct 12, 2026
hbirth pushed a commit that referenced this pull request Oct 13, 2026
With the writeback cache and DLM, fuse_filemap_fault()'s slow path
drops the fault lock, takes the DLM grant and reads the batch window
into private folios, and returns VM_FAULT_RETRY. Errors on that path
are ignored. Its comment expects a persistent error to end on the
blocking path, which turns it into SIGBUS. Since 52b0cfb ("fuse: drop
fault-around for shared-writable mappings under DLM") a
FAULT_FLAG_TRIED pass takes the drop-and-retry path too, so a retried
fault that keeps failing never gets there. Once the fault lock is
dropped, VM_FAULT_RETRY is the only answer the fault can give.

An aborted connection fails every request, so a task touching a
non-resident page of a mapping on that mount refaults forever. It
spends all its time in the kernel, ignores every signal but SIGKILL,
and its mapping keeps the mount busy, so the mount cannot be unmounted
and recovered. This was seen after the redfsd hang watchdog aborted a
hung connection: four fio mmap jobs ran at 100% CPU for minutes, each
pass allocating and freeing the batch folios in
fuse_fault_read_private_folios(), and the client agent's umount failed
with EBUSY until they were killed.

Check the connection on the slow path while the fault lock is still
held, and return VM_FAULT_SIGBUS when it is gone, which is what a
fault on a non-resident page of an aborted mount returns without DLM.
Resident pages with a recorded grant still map through the fast path.

A persistent error on a live connection, such as a server that fails
every READ, still loops the same way. Ending that needs state carried
from one retry to the next and is left out here.

This is a port to Linux 6.12 of commit 37a9748 from
redfs-ubuntu-hwe-6.17.0-16.16-24.04.1 (PR #253); the code is identical
on both branches and the patch applied with only a line offset.

Signed-off-by: Sven Oehme <soehme@ddn.com>
Signed-off-by: Allison Henderson <ahenderson@ddn.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants