From nobody Thu Apr 28 22:30:14 2022 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 7B5D51991308; Thu, 28 Apr 2022 22:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Kq9Ky2VLGz4YdG; Thu, 28 Apr 2022 22:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651185014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+e19rx5NXd5h+/FEklo94lA5ZsQNpPSrEnT4ocnDUz4=; b=YdnyPMKG0yrRAi3zY90Ft/UZOOoCF3Qz0k9zx9G9iKHMeAnjeQSANWGsmNIY2ixKaWd5Lx xVeIV50SXV1hF/zJ8lswjKeNa5Fyy1miUNbQzGe/xSbFjz5kQaXIikvRft59eAOgVNvQHC Rao9r5a/orAc1p7hDRFmrFB9ED/oqTmkH3BY+w+bijlJ8Xt76CdxKujOK+AxtO5ZJfowtz Doon9OoIDkzrQAfqXg77FpK9EVjCOwqZnqBpYjtqkI3Za3uCsoVgDWVWexyDgUlFjVsFuo /SWMEO4aUjR7T2YTZdyiqNB3epTpIdX1mSjafXc9VyTaMS/0zBN8VmP4lc2c6g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 325C720FA8; Thu, 28 Apr 2022 22:30:14 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23SMUE7F040473; Thu, 28 Apr 2022 22:30:14 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23SMUEEP040467; Thu, 28 Apr 2022 22:30:14 GMT (envelope-from git) Date: Thu, 28 Apr 2022 22:30:14 GMT Message-Id: <202204282230.23SMUEEP040467@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 9fb40baf6043 - main - cam_periph: Return ENXIO when peripheral is invalidated 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: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 9fb40baf60435c000415429220c57c754ce318fd Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651185014; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=+e19rx5NXd5h+/FEklo94lA5ZsQNpPSrEnT4ocnDUz4=; b=Inu9bPQKmjQI8KJ9m4oIjJjsCaDN0r6REvzsniIIcGSJZAI/ZXZ67Bs+qsUdPEgdE5hEef J3qaKaeA0MnzFIcDUy601wjlNHd2nRp3zWEFxQTQluKXKhLwnj9mE2nSDAodwe7+COc8r0 dLsfB/uq54vWtdvNP9qlW6rZPMGJfP09dDpUxyxH2K9fxC1wrjGvO8HrqW2Dsq5hR1V9++ VVp2MX4+WD462/UdfmHUuLz8KTXnrmDpcHp1eU3pkVACNUuR/Ck+yPHgbyK13pLmToTBl5 oMfnTzEpQe6XLz217FvfIMXVpEH6vBp3gtZNh3EOsLzVGw5ynDFP6NzufYnxOQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651185014; a=rsa-sha256; cv=none; b=jAIy1KZPiA6SuRntuptjP5ST7oPh9RRbtUCYjmuPwsy2PC8ufjiOjMyYUFmeU8SpD3OTEg tlNrdRkTAF0EhH1DRJcYCYlIBm+Q2XJl8WqXD80Gi+oRISSqrtF4W8D9dfupRZ95CRJ7w8 NKWvfH0IgMjoOtpB4aBkgUVWercz5Lz/9w5aRyNoXVTh2OBbn56PBCDbNSfHkFnlkdhwrA wcq/5ThUDRAV8cgTis5Q8JI18jYKLMft0ysCz5rbL+GELPxrbsHjhEAbx87VMapUYIHGP0 rVjLalG0oKQIzYHcWBiaikq5xjGuISZgDPbuSu32QEHfARGf2Vh0T1K9IZU4wQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=9fb40baf60435c000415429220c57c754ce318fd commit 9fb40baf60435c000415429220c57c754ce318fd Author: Warner Losh AuthorDate: 2022-04-28 22:29:39 +0000 Commit: Warner Losh CommitDate: 2022-04-28 22:30:00 +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 --- 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 7f8f0036f10b..8c7c6b53b473 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1609,7 +1609,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) { @@ -1959,7 +1959,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"; @@ -1987,7 +1987,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;