From nobody Fri Oct 24 15:01:30 2025 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4ctR25290qz6Ddwb for ; Fri, 24 Oct 2025 15:01:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pj1-x1032.google.com (mail-pj1-x1032.google.com [IPv6:2607:f8b0:4864:20::1032]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4ctR250HY0z3K6M for ; Fri, 24 Oct 2025 15:01:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pj1-x1032.google.com with SMTP id 98e67ed59e1d1-33be037cf73so2419605a91.2 for ; Fri, 24 Oct 2025 08:01:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bsdimp-com.20230601.gappssmtp.com; s=20230601; t=1761318103; x=1761922903; darn=freebsd.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=QRfngypdhPU0OonQMIhxnc+lCq6a+UeXERUBLYXIqXk=; b=Ee9noqIuyqZCrzslrqS32OvSqTMBhv/iICXMpQnv0YZqrvFIsdR85isFNrdWr7jiL/ cns1Et7Jra69BSPYgRdBrY30tovrO98wceZQO8yX6os9UQHpTDH9jyvoZgV8oKW1jByg 5une1EyvI6vtvRGtY1yNybWPr/5JDilTQ2yjq+UgFT6OM0lpfYx3G1c3sTx3C+8drOX9 jpRILG46MMnNyjG1eBvmbwckjKx+w9uB81oa8zSgViVPAN2LLHiVHe5vYzGZZ9h5bVdI EYqHAE348z6IOISwd5/5LHa1vsGOWcF8Qok2i9uDQYSSF1p4RT0R8NfKOggXeBFE0Myo SVQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1761318103; x=1761922903; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QRfngypdhPU0OonQMIhxnc+lCq6a+UeXERUBLYXIqXk=; b=IVNhWWStX+aMxkSI3N3nXLUx89kkUzZwyXBjrCdpFpRgDRMIwOJt8j7mhQB3xhaynL A0i3ARG1S6o061UihtSzcePtLLMZRex23zpVgNywuGHEo4tr1sBZyhE5Kt8ER1/7Lb7E mkKYvRdBOo5N3g03XQfNUSP5VE7hf2DS1vvVDwlbH682RqSRBTfc+aJCAiMFTkG3zK9+ Cu7BhkbrZ2t0VNZzEqwurFu/X07mtejeqZVWXSh+yCS1Fu867HXP4ScOa6hdu/gUQtg+ 1UEQmm7WKEVEv6WpG+U13x3UFsx2vjAY1B1bvpiGLjs4jVLlIkCSGuUyzHK70+9Tk295 Vh+Q== X-Forwarded-Encrypted: i=1; AJvYcCUZ9HNbO8VwgaM8Z0oypQH/yoWOF5JrxR0UwFqdiCocpYMLn+1UJcw8nSA2CgprFd7bh2i5Frk1zokDB7bSTAb0Iuzm@freebsd.org X-Gm-Message-State: AOJu0YyGuc8/rDORI31hhFTx0jMdNEbJROMrWzx7M03dTgogIKPm+Rgf cr6TxJCE3Uja1nW89gLrHf+pWSm/KNfuwl6TMc5RApgKbcz4x93fDljLRM407b1vbSn5vU1PD2S y/8BZzFD4KJ3M8SNlBrdMdlUqjWfx4CBzq9n04zPSsKAZodrUrw9G X-Gm-Gg: ASbGnctVaR+rSHcZMYbXN+k4KSKGSqdRHVVkj1d3VgGtgfAHd1/tS3rR1e/CYPa5foq Q42XoPNUcgK0E5+WgzBozOA02m+9Ow5CJOEsJ5Q3eRSJIoXfs9DK2Gmka0S/dm1DootPCoceuP7 wmmHPT7y2XFdS0fRfz0IL/gXPTuZkgrsJJkJubpNJbOvK0962h3/NsgwQRwrHBBHpcvaOXQWzME H6+PnADvL/TGinELdSnP0tmUX4ifY7E/k7KaHzGhxEGQPpdNAN3J0+TkKDBwJutmhhe+Q5R X-Google-Smtp-Source: AGHT+IEgzI2KcZIC+B2BL58SI9jX06DSxTvq4/yEAo2QYuF22vPlzy6rV9+dalUSBdiDjLEayOHUl1o7HKcISiFQ7ro= X-Received: by 2002:a17:90b:3f10:b0:32e:7270:94aa with SMTP id 98e67ed59e1d1-33bcf8e726bmr36419709a91.19.1761318102162; Fri, 24 Oct 2025 08:01:42 -0700 (PDT) List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 References: <202510240741.59O7fBAe041995@gitrepo.freebsd.org> <202510241012.59OACUDA002781@critter.freebsd.dk> <202510241116.59OBG1ii003074@critter.freebsd.dk> <202510241314.59ODEq5a035616@critter.freebsd.dk> <202510241450.59OEo3Vp043004@critter.freebsd.dk> In-Reply-To: <202510241450.59OEo3Vp043004@critter.freebsd.dk> From: Warner Losh Date: Fri, 24 Oct 2025 11:01:30 -0400 X-Gm-Features: AS18NWC9nO57atdOXOZ4X1lZr4Zj99AJahOrKb4xB8W79MYEraq3Rv89pD8tckk Message-ID: Subject: Re: git: 2612f1b8649b - main - deadfs: Return ENXIO instead of EIO when the device is gone. To: Poul-Henning Kamp Cc: Konstantin Belousov , src-committers , "" , "" Content-Type: multipart/alternative; boundary="000000000000d0eb540641e8d38b" X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4ctR250HY0z3K6M --000000000000d0eb540641e8d38b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Oct 24, 2025, 10:50=E2=80=AFAM Poul-Henning Kamp 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 (=3Dconsole) > 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 incompetenc= e. > --000000000000d0eb540641e8d38b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


On Fri, Oct 24, 2025, 10:50=E2= =80=AFAM Poul-Henning Kamp <phk@ph= k.freebsd.dk> wrote:
I updat= ed 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:

=C2=A0 =C2=A0 =C2=A0 =C2=A0 read(2) syscall
=C2=A0 =C2=A0 =C2=A0 =C2=A0 all the way down to CAM
=C2=A0 =C2=A0 =C2=A0 =C2=A0 for 4(?) retries:
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 CAM sends CCB down<= br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 CAM gets CCB back w= ith error
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 CAM printf's tw= o lines to console
=C2=A0 =C2=A0 =C2=A0 =C2=A0 CAM returns EIO
=C2=A0 =C2=A0 =C2=A0 =C2=A0 userland gets EIO
=C2=A0 =C2=A0 =C2=A0 =C2=A0 userland printf's to stdout (=3Dconsole)

Wha= t 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 devic= e being gone. We don't kick that off until the usb stack starts its det= ach teardown. I've not walked through that.=C2=A0

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

I'm guessing it do= esn'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=C2=A0 =C2=A0 =C2=A0 =C2=A0| UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0| TCP/IP since RFC 956
FreeBSD committer=C2=A0 =C2=A0 =C2=A0 =C2=A0| BSD since 4.3-tahoe=C2=A0 =C2= =A0
Never attribute to malice what can adequately be explained by incompetence.=
--000000000000d0eb540641e8d38b--