Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Oct 2025 09:12:18 -0400
From:      Warner Losh <imp@bsdimp.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        Poul-Henning Kamp <phk@phk.freebsd.dk>, 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:  <CANCZdfrCa7PXtXEPU-O5Lgn3CkY86u-%2BP=pxVz%2BszAVxij9Hgw@mail.gmail.com>
In-Reply-To: <aPtnt9siqT5R_32l@kib.kiev.ua>
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>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Fri, Oct 24, 2025, 7:49 AM Konstantin Belousov <kostikbel@gmail.com>
wrote:

> On Fri, Oct 24, 2025 at 11:16:01AM +0000, Poul-Henning Kamp wrote:
> > --------
> > Konstantin Belousov writes:
> >
> > > On Fri, Oct 24, 2025 at 10:12:30AM +0000, Poul-Henning Kamp wrote:
> >
> > > I do not think that DRM really affects the code path for io.
> >
> > 100% agreement.
> >
> > But it can change the order of thread/interrupt/event-handling
> > scheduling.
> >
> > When I tested the ENXIO patch, I started booting an unmodified
> > kernel in single-user and immediately got ENXIO when I pulled
> > the USB stick - quite to my surprise.
> >
> > Then I kldloaded i915kms, still in single-user, and now I got
> > the observed bad EIO behaviour.
> >
> > With a fixed kernel and i915kms loaded, I saw four or five reads
> > return EIO before one got ENXIO and terminated recoverdisk.
> >
> > Getting a handful of EIO's before the ENXIO finally appears
> > strongly suggests that some of the eventhandling related to
> > the disappearing USB stick is being held up by something.
> >
> > As soon as I can, I'll try to gather more data.
>
> It might make sense to annotate CAM EIOs with EXTERROR().
> But then, we probably need to add something to copy that
> extended data between threads and possibly extend struct buf/bio
> witg the place for exterror data besides b_error.
>

Given the contexts cam runs in, managing the storage for that can be hard.

Warner

>

[-- 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, 7:49 AM Konstantin Belousov &lt;<a href="mailto:kostikbel@gmail.com">kostikbel@gmail.com</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Fri, Oct 24, 2025 at 11:16:01AM +0000, Poul-Henning Kamp wrote:<br>
&gt; --------<br>
&gt; Konstantin Belousov writes:<br>
&gt; <br>
&gt; &gt; On Fri, Oct 24, 2025 at 10:12:30AM +0000, Poul-Henning Kamp wrote:<br>
&gt; <br>
&gt; &gt; I do not think that DRM really affects the code path for io.<br>
&gt; <br>
&gt; 100% agreement.<br>
&gt; <br>
&gt; But it can change the order of thread/interrupt/event-handling<br>
&gt; scheduling.<br>
&gt; <br>
&gt; When I tested the ENXIO patch, I started booting an unmodified<br>
&gt; kernel in single-user and immediately got ENXIO when I pulled<br>
&gt; the USB stick - quite to my surprise.<br>
&gt; <br>
&gt; Then I kldloaded i915kms, still in single-user, and now I got<br>
&gt; the observed bad EIO behaviour.<br>
&gt; <br>
&gt; With a fixed kernel and i915kms loaded, I saw four or five reads<br>
&gt; return EIO before one got ENXIO and terminated recoverdisk.<br>
&gt; <br>
&gt; Getting a handful of EIO&#39;s before the ENXIO finally appears<br>
&gt; strongly suggests that some of the eventhandling related to<br>
&gt; the disappearing USB stick is being held up by something.<br>
&gt; <br>
&gt; As soon as I can, I&#39;ll try to gather more data.<br>
<br>
It might make sense to annotate CAM EIOs with EXTERROR().<br>
But then, we probably need to add something to copy that<br>
extended data between threads and possibly extend struct buf/bio<br>
witg the place for exterror data besides b_error.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Given the contexts cam runs in, managing the storage for that can be hard.</div><div dir="auto"><br></div><div dir="auto">Warner</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">
</blockquote></div></div></div>
home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfrCa7PXtXEPU-O5Lgn3CkY86u-%2BP=pxVz%2BszAVxij9Hgw>