Date: Tue, 28 Oct 2025 02:58:15 GMT From: Colin Percival <cperciva@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 74a6de9f9625 - releng/15.0 - deadfs: Return ENXIO instead of EIO when the device is gone. Message-ID: <202510280258.59S2wFXt084780@gitrepo.freebsd.org>
index | next in thread | raw e-mail
The branch releng/15.0 has been updated by cperciva: URL: https://cgit.FreeBSD.org/src/commit/?id=74a6de9f962506fa5d8b75aad0d664c3c164143d commit 74a6de9f962506fa5d8b75aad0d664c3c164143d Author: Poul-Henning Kamp <phk@FreeBSD.org> AuthorDate: 2025-10-24 07:19:31 +0000 Commit: Colin Percival <cperciva@FreeBSD.org> CommitDate: 2025-10-28 02:58:00 +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 that drm-kmod-66/i915kms may be the condition which trigger the different code-path. Approved by: re (cperciva) MFC to: stable/15 Fixes: 289785 Thanks to: imp, kib (cherry picked from commit 2612f1b8649bb4f069a6a064ed714daa5f10d037) (cherry picked from commit 44e214f8241faa224e2346a5a03db8c029a7d4af) --- 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) + return (0); + return (ENXIO); } int dead_write(struct vop_write_args *ap) { - return (EIO); + return (ENXIO); } inthome | help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202510280258.59S2wFXt084780>
