Date: Sat, 28 Dec 2024 18:01:19 GMT From: Warner Losh <imp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: fce635e02667 - stable/13 - cam_periph: Return ENXIO when peripheral is invalidated Message-ID: <202412281801.4BSI1JpU038461@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fce635e026676839e030c54499b16bc3dfce17e1 commit fce635e026676839e030c54499b16bc3dfce17e1 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2024-12-28 17:59:59 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-12-28 18:00:56 +0000 cam_periph: Return ENXIO when peripheral is invalidated When the peripheral is invalidated, no further I/O is possible. Signal this up the stack with ENXIO now that upper layers of the stack differentiate sometimes. In order for there to be further I/O, and new open is required for any block device that a future periph might instantiate for devices at this location that might return or otherwise become available. The I/O scheduler flushes its I/O with the ENXIO error for pending I/O that didn't make it to the device, so this makes the two paths match. MFC After: 3 days Sponsored by: Netflix Reviewed by: chs, mav Differential Revision: https://reviews.freebsd.org/D35093 (cherry picked from commit 9fb40baf60435c000415429220c57c754ce318fd) --- sys/cam/cam_periph.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index 415ee1e42064..21abebc416ae 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1598,7 +1598,7 @@ camperiphscsistatuserror(union ccb *ccb, union ccb **orig_ccb, */ periph = xpt_path_periph(ccb->ccb_h.path); if (periph->flags & CAM_PERIPH_INVALID) { - error = EIO; + error = ENXIO; *action_string = "Periph was invalidated"; } else if ((sense_flags & SF_RETRY_BUSY) != 0 || ccb->ccb_h.retry_count > 0) { @@ -1940,7 +1940,7 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, /* Unconditional requeue if device is still there */ if (periph->flags & CAM_PERIPH_INVALID) { action_string = "Periph was invalidated"; - error = EIO; + error = ENXIO; } else if (sense_flags & SF_NO_RETRY) { error = EIO; action_string = "Retry was blocked"; @@ -1968,7 +1968,7 @@ cam_periph_error(union ccb *ccb, cam_flags camflags, case CAM_DATA_RUN_ERR: default: if (periph->flags & CAM_PERIPH_INVALID) { - error = EIO; + error = ENXIO; action_string = "Periph was invalidated"; } else if (ccb->ccb_h.retry_count == 0) { error = EIO;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202412281801.4BSI1JpU038461>