Date: Fri, 24 Oct 2025 11:01:30 -0400 From: Warner Losh <imp@bsdimp.com> To: Poul-Henning Kamp <phk@phk.freebsd.dk> Cc: Konstantin Belousov <kostikbel@gmail.com>, src-committers <src-committers@freebsd.org>, "<dev-commits-src-all@freebsd.org>" <dev-commits-src-all@freebsd.org>, "<dev-commits-src-main@freebsd.org>" <dev-commits-src-main@freebsd.org> Subject: Re: git: 2612f1b8649b - main - deadfs: Return ENXIO instead of EIO when the device is gone. Message-ID: <CANCZdfrTZCCFqeMmLNVfm_R9uUfOrOgnT9m5nABOPWvAdwnKjg@mail.gmail.com> In-Reply-To: <202510241450.59OEo3Vp043004@critter.freebsd.dk> References: <202510240741.59O7fBAe041995@gitrepo.freebsd.org> <aPs27Dc_w10t3ENH@kib.kiev.ua> <202510241012.59OACUDA002781@critter.freebsd.dk> <aPtWo1UP-UpPdsVf@kib.kiev.ua> <202510241116.59OBG1ii003074@critter.freebsd.dk> <aPtnt9siqT5R_32l@kib.kiev.ua> <CANCZdfrCa7PXtXEPU-O5Lgn3CkY86u-%2BP=pxVz%2BszAVxij9Hgw@mail.gmail.com> <202510241314.59ODEq5a035616@critter.freebsd.dk> <202510241450.59OEo3Vp043004@critter.freebsd.dk>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --] 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. > [-- Attachment #2 --] <div dir="auto"><div><br><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Fri, Oct 24, 2025, 10:50 AM Poul-Henning Kamp <<a href="mailto:phk@phk.freebsd.dk">phk@phk.freebsd.dk</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I updated the "ThinkCenter" to 15-BETA2-p1 and made some experiments<br> and I get different results no than before.<br> <br> This is obviously without the fix.<br> <br> <br> Now I see 25 read(2)'s return EIO before ENXIO arrives.<br> <br> Each of those 25 read(2)'s do:<br> <br> read(2) syscall<br> all the way down to CAM<br> for 4(?) retries:<br> CAM sends CCB down<br> CAM gets CCB back with error<br> CAM printf's two lines to console<br> CAM returns EIO<br> userland gets EIO<br> userland printf's to stdout (=console)<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">What are the cam messages?</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> And only then does ENXIO finally appear.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">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. </div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> This is single-user mode with a random old USB stick.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">I'm guessing it doesn't matter... I'll see if i can repeat these result when I return.</div><div dir="auto"><br></div><div dir="auto">Warner</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote gmail_quote_container"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> i915kms does not seem to affect the result in this experiment.<br> <br> I'm buildLLVM'ing on my laptop, will perform more experiments<br> on that platform once that is complete<br> <br> Poul-Henning<br> <br> -- <br> Poul-Henning Kamp | UNIX since Zilog Zeus 3.20<br> phk@FreeBSD.ORG | TCP/IP since RFC 956<br> FreeBSD committer | BSD since 4.3-tahoe <br> Never attribute to malice what can adequately be explained by incompetence.<br> </blockquote></div></div></div>home | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrTZCCFqeMmLNVfm_R9uUfOrOgnT9m5nABOPWvAdwnKjg>
