From nobody Tue May 03 20:50:46 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 359451AB75CC; Tue, 3 May 2022 20:50:47 +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 4KtBtv0pDhz4nyT; Tue, 3 May 2022 20:50:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651611047; 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=v6hDADu2X8y/xhoSn/enUOdrhJVCyWETNlJeuFFLFdw=; b=k2aQ58YRCC1BlQE+4GBI5lcjmsNCIPeAB1OCbfTMAFkfZPtqbIoVOS8Ppn7AkioLwuHhJG ptYiXfQTbakHNaOK3o3sAHy3YcNQBCsnk3pqG5V8QVXIXu2Iloe5/JN4Lp8bl1aI+18Qx0 4NA6ufpAPMMF5IhEChtB+ZtRQ9L/qQBE/IMZCnFIMTgq9ToUqqtOLX118QiFS+4E03qZKn ffgK5f1GdEpg5T14MK6b85elLG/PXXcVsqbxcsaR287Ez6JeKMJgrXl7XJQmK3LudLd6YA AvpPG5geI/tcD4C0aCEBKGX/jY7upv7t1ehuayCN5Im/OcSDU8h1JwPgoVrpzA== 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 EF92925801; Tue, 3 May 2022 20:50:46 +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 243Kokog033933; Tue, 3 May 2022 20:50:46 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 243KokiS033932; Tue, 3 May 2022 20:50:46 GMT (envelope-from git) Date: Tue, 3 May 2022 20:50:46 GMT Message-Id: <202205032050.243KokiS033932@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: 84849cfd1dc0 - stable/13 - CAM: Keep periph_links when restoring CCB in camperiphdone(). 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: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 84849cfd1dc016917402511bc5a55d3d7317ce39 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651611047; 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=v6hDADu2X8y/xhoSn/enUOdrhJVCyWETNlJeuFFLFdw=; b=LVluDpT4PAbbSEccvNqIPLsk6mJCKsWbAG6RaAapK2daFjq8SeDoKnvuWDiZB3PFiC1Rq1 A6yYeEMKROe4OSlejp5uiRb9fqvZE0QAq5976ulDs6emBwxbfF/wP02TAgJbLcpmFXFjQL Yq3aVCk6CGiUOsxPv4mAbovgzxqO6Oea0918DCn7sHPdj6oytfF1Rn1otlAxaz8d+9Ln+t 4Jd+oza46w+MpjzfbypqHPQNmHVghGjqUG9mLwJ4zV9CT/aaiX82nf/Ig81uMJR++geKyi lirMa+lSMN7JKYZhcSw3qAJxT4oThKYQ/8u0mmUXP9KHoKIIXelZIRdw8AB5tw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651611047; a=rsa-sha256; cv=none; b=ZLgWiqWleC6O/4hj9MyJCtyHfze7aYQMrlv7iA3LgOFggi4JUYGgOsa9CjZQMAI/jTOlm3 k7S+Czye+9f6MY+P76LOr/9xue24InQzb7iNL/933SXrKQKBF5CIe7odleUQrOKJdD9GDB Hw+uHGLqsoTv4cyTEzzdDh5aeftVCwCXOIJQk6xQcSQTLQaDMG6PAoLv/MqWuamqKNIwtJ kVqWd4KdUJ041bH3p7ybA350hLiYuZoQCny96qpDBHpKc8Xug9weM6vpXFLMG3UYeEX9zM BG/SKhXLYRP2xU/gWrWzmHFprsOHAlxvbRW3quHHjrWEeYSPbh2oftCCB+uZkA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=84849cfd1dc016917402511bc5a55d3d7317ce39 commit 84849cfd1dc016917402511bc5a55d3d7317ce39 Author: Alexander Motin AuthorDate: 2022-04-28 01:39:50 +0000 Commit: Alexander Motin CommitDate: 2022-05-03 20:32:45 +0000 CAM: Keep periph_links when restoring CCB in camperiphdone(). While recovery command executed, some other commands from the periph may complete, that may affect periph_links of this CCB. So restoring original CCB we must keep current periph_links as more up to date. I've found this triggering assertions with debug kernel and suspect some memory corruptions otherwise when spun down disk receives two or sometimes more concurrent requests. MFC after: 1 week Sponsored by: iXsystems, Inc. (cherry picked from commit 404f001161b975164d8b52d9f404d07ac7584027) --- sys/cam/cam_periph.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sys/cam/cam_periph.c b/sys/cam/cam_periph.c index d08adca0ea1c..9a4f4a2b160b 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1421,6 +1421,7 @@ camperiphdone(struct cam_periph *periph, union ccb *done_ccb) * and the result will be the final one returned to the CCB owher. */ saved_ccb = (union ccb *)done_ccb->ccb_h.saved_ccb_ptr; + saved_ccb->ccb_h.periph_links = done_ccb->ccb_h.periph_links; bcopy(saved_ccb, done_ccb, sizeof(*done_ccb)); xpt_free_ccb(saved_ccb); if (done_ccb->ccb_h.cbfcnp != camperiphdone)