From nobody Sat Dec 28 18:01:19 2024 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 4YL9Cg3mCtz5hyHQ; Sat, 28 Dec 2024 18:01:19 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YL9Cg20JZz4sXk; Sat, 28 Dec 2024 18:01:19 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735408879; 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=Qdg85mAicWAhJplEN8tPxzmaFnT0imDXzUnDrU8OOSw=; b=chzblxh094wpiZKr7QD64LAZyBmi/iGR/v1edJkOifk5Nb1TP/efKyjp2RXXKNpT6Fq0HN dYTseG7yZNZkPSRglWAXg/BW6ncJT92T7UxRLj116j8iWsf36FN+0qaKOhYCwQDDDtIykz 8hvnOI2c5gowhg0rVrO0325v9/bMHaCRissoaG3eXXKV2xsp333orSG1qTSkmyxa7T+y0g q0E4oT1VdRwJnX3nyRS2b1XsTgpY7WwzIX2D9SjU7hr7aABdMU9+VNGLFCN2MCsjAkZDPS zX/NmKxnPC2ni82MRDTrbxCCs5WdxqcD6B7uS/7D0CfNkrzewKSgVwDTbbyhvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1735408879; 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=Qdg85mAicWAhJplEN8tPxzmaFnT0imDXzUnDrU8OOSw=; b=BNMSjSTBW8WFPpluF7296+P8tI23Y0/DwaC7FfryIRXjBxaTXMbL1t1XDuQ0cu9kT2VbW7 k0VuhsMSCt0Ct076hnABJqJEqJT4OXPnZJ/2P27f70XlR2iflPolfGsWBOG9p6qzFjZH57 Z51x9U3sE2x1xcMDjZlsEMGTt+jJ/HPxfpal8ocwx+4p63vTO7XIiAqXlCIlCz/Z4WlSWO EQDBINoUlN75Cv1VeEySQSc4F98iRJHOQtOGusBurOFn+Z6+xGxza+zj6A/eZ0QQgrJc2I NoieN36TCHa+6ScgLidReOxAkDfVpl5seFStxWkrdEhUK82nCLRlUb93ewVNSw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1735408879; a=rsa-sha256; cv=none; b=KwmM8KsdOzzbO0M7bsqYQkQvxL9OxAoU290rVmT8epeY0ReQtgbrVaYsAqnitqNJ82SBOA e68qGWTHE8rQW+j57cMPWNj7+ZFTOMrBQCXKfGmEf7v4giP6diJkKdFeyYveq/zVnaF37+ OzJloatmtS1cuAvLMFhY0ki56IR+0mIQxrNPMGyOKuwjRMUaysC6v7tm08n+etGi0DYPD5 655/m7o3y7ZURfBf1Aw3pl+6yaVauJuSmhMjJFQ5FTHxOnTTIQ/4N2HTBBzJraxNlwFME6 5AJcT87pgtmrSfvw6aiZZwu4irLbHcmt+5UdciVqseAzuekcHRySGsHgdSZbag== 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 4YL9Cg1VLQzZZr; Sat, 28 Dec 2024 18:01:19 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4BSI1JM8038464; Sat, 28 Dec 2024 18:01:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4BSI1JpU038461; Sat, 28 Dec 2024 18:01:19 GMT (envelope-from git) Date: Sat, 28 Dec 2024 18:01:19 GMT Message-Id: <202412281801.4BSI1JpU038461@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: fce635e02667 - stable/13 - 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: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-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/stable/13 X-Git-Reftype: branch X-Git-Commit: fce635e026676839e030c54499b16bc3dfce17e1 Auto-Submitted: auto-generated The branch stable/13 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=fce635e026676839e030c54499b16bc3dfce17e1 commit fce635e026676839e030c54499b16bc3dfce17e1 Author: Warner Losh AuthorDate: 2024-12-28 17:59:59 +0000 Commit: Warner Losh 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;