Re: git: 2612f1b8649b - main - deadfs: Return ENXIO instead of EIO when the device is gone.

From: Warner Losh <imp_at_bsdimp.com>
Date: Fri, 24 Oct 2025 15:01:30 UTC
On Fri, Oct 24, 2025, 10:50 AM Poul-Henning Kamp <phk@phk.freebsd.dk> wrote:

> I updated the "ThinkCenter" to 15-BETA2-p1 and made some experiments
> and I get different results no than before.
>
> This is obviously without the fix.
>
>
> Now I see 25 read(2)'s return EIO before ENXIO arrives.
>
> Each of those 25 read(2)'s do:
>
>         read(2) syscall
>         all the way down to CAM
>         for 4(?) retries:
>                 CAM sends CCB down
>                 CAM gets CCB back with error
>                 CAM printf's two lines to console
>         CAM returns EIO
>         userland gets EIO
>         userland printf's to stdout (=console)
>

What are the cam messages?

And only then does ENXIO finally appear.
>

So we are racing the detach thread here. The errors in the transactions
aren't yet recognized as the device being gone. We don't kick that off
until the usb stack starts its detach teardown. I've not walked through
that.

This is single-user mode with a random old USB stick.
>

I'm guessing it doesn't matter... I'll see if i can repeat these result
when I return.

Warner

i915kms does not seem to affect the result in this experiment.
>
> I'm buildLLVM'ing on my laptop, will perform more experiments
> on that platform once that is complete
>
> Poul-Henning
>
> --
> Poul-Henning Kamp       | UNIX since Zilog Zeus 3.20
> phk@FreeBSD.ORG         | TCP/IP since RFC 956
> FreeBSD committer       | BSD since 4.3-tahoe
> Never attribute to malice what can adequately be explained by incompetence.
>