From nobody Wed May 04 01:02:10 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 DE0621ACF11A; Wed, 4 May 2022 01:02:10 +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 4KtJSy5qz7z4Tnq; Wed, 4 May 2022 01:02:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651626130; 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=V8r8JPyPOe6GY+Wx0sq5X+71lQGMTxGwBCFiX7mGLcE=; b=JzAof6TnaRXf+qZarFClDyF5psR/Cpo2EayE/fOd93gH93n844U13TxunI9+F4VcSrWeXv uwbqmkpj3fZ5QCHUTuWTzb2E7i5dLqjGvLr8Em3BP8JalfUlagmzQma7AR5J9axkUtugZj 4M9DZVG8Lj1NQY0q8xYXhRPbHzZ7OBtirDZjHMxnx5n82ADezhA+be5RvpyTh0CpvGR5mt N8bxOeIJD3ax2Kf8Boqcbnr1NoiXk6roI2CBl1ifNBl2kSu2tx9DHhlAyeaMmpxVYu+6r1 7AOb1QysBFq6nu4i6FWEq9jGZahjX9w12Aauy+7AVVusOx1nH6xdMd6D2GXB1g== 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 A82FCDB4; Wed, 4 May 2022 01:02:10 +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 24412AUQ069844; Wed, 4 May 2022 01:02:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 24412ApE069843; Wed, 4 May 2022 01:02:10 GMT (envelope-from git) Date: Wed, 4 May 2022 01:02:10 GMT Message-Id: <202205040102.24412ApE069843@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: 8dab6aba5f6e - stable/12 - 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/12 X-Git-Reftype: branch X-Git-Commit: 8dab6aba5f6ee635e4ff3f313d0209af718ea42f Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1651626130; 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=V8r8JPyPOe6GY+Wx0sq5X+71lQGMTxGwBCFiX7mGLcE=; b=ER0+jPnMtGwzkc5KudotfZJTGzKLegqea0vdamCWvwB+MLXzEpuWzzIhd76ErwLWdPVuPp F/g9PL3c0B07QcuLdTpBDqbcO458/IFRiuiq2p9bw38lLJ0xuVSKRHMiO7+2dQd1/W/80d xX6W8N8xmxWO7Disa+CN/X4qc1YBAIOUEL+H1DcslCE6w4eY6n3xaZwM46fQCF4i0e6c2L u/T2sC89mKHloHVd66ozVuklPUJhVrERAnqFoyuY1v3Bmgs0LnIOoGQNR9zdFjCaJ3MPgA AbdSir//DkAAe9CAofodRhFS3CpYQ8sUKW6Y6Pdcw4w2r6n4NBQ+9OmWZToNWg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1651626130; a=rsa-sha256; cv=none; b=ucM+yfo6fwULuhNQM8rRrMqYB7H2uugFzyh5SUZtJm+sa2/rNxDRQ+hAFIc2xyFMXubd69 pT1UlMl7XJMrxnY/b6nkxvWIszz7t4c1NvEzbHV/VDMKJlSgeUB8Zk7y0kZlJCUokQnoPC L54QcrAa75oBcjjFnfPplsjbxICVH5YgB/zTdyZgb2Gzrqv4Nr+t93MJlYzlVVumUoQqWr jdSpimTJnSDaq0GISkZk5c8BlDlhplwZxhEVZtsBshPFnjRXEhnDXIIKMkwt6351gTD7MU q0/QOTquZqdNM6OxMGFyDZ9vF8tgiKO4S6rUIOwfNuhT0RK4bprlX5xFAFXwkg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=8dab6aba5f6ee635e4ff3f313d0209af718ea42f commit 8dab6aba5f6ee635e4ff3f313d0209af718ea42f Author: Alexander Motin AuthorDate: 2022-04-28 01:39:50 +0000 Commit: Alexander Motin CommitDate: 2022-05-04 01:02:00 +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 2744541097dd..125e7e60cac7 100644 --- a/sys/cam/cam_periph.c +++ b/sys/cam/cam_periph.c @@ -1441,6 +1441,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)