Conversation
Correctness gaps remained in the guest-internal FUSE transport and the
CLONE_THREAD path after the initial landing. Multi-model review flagged
them; this change closes them.
FUSE wait-path EINTR (src/syscall/fuse.c, src/syscall/signal.{c,h}):
- A new helper signal_pending_interruption(restart_out) inspects every
unblocked pending bit and reports whether the effective delivery is
non-disruptive for every signal in the set. A signal is
non-disruptive when its handler is SIG_IGN, when SIG_DFL resolves to
default-ignore (SIGCHLD, SIGURG, SIGWINCH), or when a user handler
has SA_RESTART set. Any other signal forces the caller to treat the
wait as interrupted, so a SIGTERM hiding behind an ignored SIGCHLD
cannot stay invisible to the caller.
- fuse_request_locked detaches the request and returns -EINTR only
when the deliverable set contains a disruptive signal. SA_RESTART
and ignored signals let the wait continue until the daemon replies,
matching the application-visible contract of those handlers and
avoiding a useless FUSE_INTERRUPT for work the guest still wants.
FUSE_FORGET reference-count integrity (src/syscall/fuse.c):
- fuse_walk_path_locked drops the previous component's lookup hold on
any error return so partial-walk failures (e.g. ENOENT on a deep
component) no longer leak a reference per surviving prefix.
- fuse_release_common_locked emits a compensating FUSE_FORGET on the
O_PATH path. O_PATH opens skip FUSE_OPEN but still consume an
nlookup during the walk; the prior early-return left that ref
hanging on the daemon.
- fuse_lookup_locked issues a single compensating FUSE_FORGET when
the per-session ref table is full so the daemon's nlookup view
stays balanced even when elfuse runs out of local capacity.
- The per-session ref table cap rises from 256 to 4096 so realistic
recursive walks no longer hit the compensating-FORGET path.
CLONE_THREAD startup-readiness (src/runtime/forkipc.c):
- sys_clone_thread waits on a thread_startup_t condvar until the
worker reports current_thread publication or an explicit -EIO
failure. The worker's HVF bring-up (hv_vcpu_create plus every
sysreg, GPR, SIMD, and PC write) goes through a checked WORKER_HV
macro, so a transient HVF error rolls back instead of aborting the
process via HV_CHECK.
- The startup_failed cleanup path drops the thread slot before
destroying the vCPU, so a concurrent thread_interrupt_all cannot
observe a slot whose t->vcpu has just been cleared.
- Both failure paths (pthread_create EAGAIN and post-handshake -EIO)
roll back PARENT_SETTID and CHILD_SETTID guest writes so the caller
never observes a live-looking TID for a thread that never started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three correctness gaps remained in the guest-internal FUSE transport and the CLONE_THREAD path after the initial landing. Multi-model review flagged them; this change closes them.
FUSE wait-path EINTR (src/syscall/fuse.c, src/syscall/signal.{c,h}):
FUSE_FORGET reference-count integrity (src/syscall/fuse.c):
CLONE_THREAD startup-readiness (src/runtime/forkipc.c):
Summary by cubic
Tightens FUSE wait semantics and lookup ref accounting, and adds a CLONE_THREAD startup handshake to avoid stale TIDs and races. Improves correctness for interrupted FUSE I/O, path walks, and thread bring-up.
Written for commit ad15853. Summary will update on new commits. Review in cubic