From nobody Fri Oct 24 08:21:00 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 4ctG7l1Djfz6DnKL; Fri, 24 Oct 2025 08:21:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4ctG7k67M5z3PSm; Fri, 24 Oct 2025 08:21:06 +0000 (UTC) (envelope-from kostikbel@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: from tom.home (kib@localhost [127.0.0.1] (may be forged)) by kib.kiev.ua (8.18.1/8.18.1) with ESMTP id 59O8L0OV056426; Fri, 24 Oct 2025 11:21:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua 59O8L0OV056426 Received: (from kostik@localhost) by tom.home (8.18.1/8.18.1/Submit) id 59O8L0L2056425; Fri, 24 Oct 2025 11:21:00 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 24 Oct 2025 11:21:00 +0300 From: Konstantin Belousov To: Poul-Henning Kamp Cc: src-committers@freebsd.org, dev-commits-src-all@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: References: <202510240741.59O7fBAe041995@gitrepo.freebsd.org> 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 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <202510240741.59O7fBAe041995@gitrepo.freebsd.org> X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FORGED_GMAIL_RCVD,FREEMAIL_FROM, NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on tom.home X-Spamd-Bar: ---- X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:6939, ipnet:2001:470::/32, country:US] X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Rspamd-Queue-Id: 4ctG7k67M5z3PSm On Fri, Oct 24, 2025 at 07:41:11AM +0000, Poul-Henning Kamp wrote: > The branch main has been updated by phk: > > URL: https://cgit.FreeBSD.org/src/commit/?id=2612f1b8649bb4f069a6a064ed714daa5f10d037 > > commit 2612f1b8649bb4f069a6a064ed714daa5f10d037 > Author: Poul-Henning Kamp > AuthorDate: 2025-10-24 07:19:31 +0000 > Commit: Poul-Henning Kamp > CommitDate: 2025-10-24 07:19:31 +0000 > > deadfs: Return ENXIO instead of EIO when the device is gone. > > One some systems, under some conditions, pulling a USB stick would > read(2) returning EIO and not ENXIO, like it should and used to. > > Recoverdisk(1), which does not give up on EIO, like most programs > would, spins furiously. > > Arguably, deadfs was always wrong in returning EIO, because once you > get to deadfs no operation will ever work again, but we used to > take a different path through devfs_vnops.c which got us the ENXIO. > > Something changed recently, and while testing this fix, I noticed Nothing changed WRT code, it is just a race that causes the behavior. > that drm-kmod-66/i915kms may be the condition which trigger > the different code-path. > > MFC to: stable/15 > Fixes: 289785 > Thanks to: imp, kib > --- > sys/fs/deadfs/dead_vnops.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > diff --git a/sys/fs/deadfs/dead_vnops.c b/sys/fs/deadfs/dead_vnops.c > index 296cf058f8c9..137c86b65058 100644 > --- a/sys/fs/deadfs/dead_vnops.c > +++ b/sys/fs/deadfs/dead_vnops.c > @@ -122,18 +122,18 @@ dead_read(struct vop_read_args *ap) > { > > /* > - * Return EOF for tty devices, EIO for others > + * Return EOF for tty devices, ENXIO for others > */ > - if ((ap->a_vp->v_vflag & VV_ISTTY) == 0) > - return (EIO); > - return (0); > + if (ap->a_vp->v_vflag & VV_ISTTY) Old style with explicit '== 0' was more style-correct. > + return (0); > + return (ENXIO); > } > > int > dead_write(struct vop_write_args *ap) > { > > - return (EIO); > + return (ENXIO); > } > > int