From nobody Fri Oct 24 15:01:30 2025 X-Original-To: dev-commits-src-main@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 4ctR253STNz6DfLY for ; Fri, 24 Oct 2025 15:01:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Received: from mail-pf1-x436.google.com (mail-pf1-x436.google.com [IPv6:2607:f8b0:4864:20::436]) (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 4ctR250TnKz3KK9 for ; Fri, 24 Oct 2025 15:01:49 +0000 (UTC) (envelope-from wlosh@bsdimp.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-782e93932ffso1809488b3a.3 for ; Fri, 24 Oct 2025 08:01:49 -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=BXRa2kM+PkxmIekQIUtUZL4wGE4Qctc6AbV5GSKrHaOUOQomfEgUwU9xlKknuuWxHG 0RYgo/k55CNsJCWZNP2wVOtCPKzO3mFbSJ6ln1gjiX+ICCazotCId2w4Vc7s5AlNxJl+ 7oo3eg7l1EbsSBvQL8S6hB4epGABafTBl2Sx67fdJkw3ODKcwRxT008abNlNi3KwVyBC Dh3VP9vY+Oudz80vJK3/rE2MHxRXvvZfLCQs2rleGHC49PlO6Kd4HNd+IWckIC5/usMR 4qtKj7HMMld2i0mDrXsoekDBsso/2pHAOnDN2WL6tpcO37cPtlzNDhnmzT5Wkz1l2MQd qPUg== X-Forwarded-Encrypted: i=1; AJvYcCXEpPWmdzUHq4yrOwLH37Ts1/NF2wXcqVkNJ2+WwwuNUXkGSxVssNFPuzx5AIu5cPI2jKEWU1o/TeYg+YR9DFFTFr0uPQ==@freebsd.org X-Gm-Message-State: AOJu0YwWhddxe2LR/s7GMbhmHO24/Fhf8dNnPsGndUyWBmzGzA/OH51V zvt7XL+lIrSCDgMCIZ09YQspuH0xsEh21baiayrxg+/s4CCVSDgA2ZVobegNW4LSVlo2gHoAlsO LntpUefODdupmB5UG12Ck1aHyMjUNbY8R32qHopsqng== X-Gm-Gg: ASbGncvJ2QX1yq4GXaWTlrSVeaD/R/qNIQRQxE3noj/GSeCHjnLL5UYdVCcRz8T8EBT b+a3SEsBRHUlaeMqZ9mE3TTSqoi/D4MjFiZ8TJj15YmPXTLdn+Cp4ofRscDHDHrnxbz/hPHjdnY QSMPzVz7qFwJgMcSASI2VsuWn6BUWotr6K3bbgx+2z1IS+EP0McOjUNZKzGzI9XMRoOZLHE5uGY lA6UgUh3kJn+UQ+ZVdBolxCUI/LLDHb8CkSlzjBI3xjNKSgXscvzEhsZtTX+Ilwn+M634BN 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 the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 4ctR250TnKz3KK9 --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--