From nobody Sat Apr 23 23:03:44 2022 X-Original-To: dev-commits-src-branches@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 773B91A8BA70; Sat, 23 Apr 2022 23:03:44 +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 4Km6Jw2wtRz3LXD; Sat, 23 Apr 2022 23:03:44 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650755024; 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=82JKPrlm6U2wxXAi5tp4StSY1O96RaSqUZvWqAIGGPk=; b=Dv+6XaetvRxjJ66YjRy1s3DtzAHyWfkN+El791rtnYgPUgy8gYRRp7HdqUtlIkdaaQmLgp Zap1jLdAQp7yYG5+jsJ1BrQW39JrR1WgEFQAhsS6BGKY6FqwgsB2r1VbyFe+QbpLS/lxfk SVHDlS6yttyY4nMXRp8f11yLZJ9iYpw7PUu3IThcpJlp6MuJCimkhQyM0rXSEqXH6K5kGB X7b1BLQ4M3i5PopAINCKAQRFpkiYBPw8jIIh5zENrDsRtJAQ/7qtF40qt0hM46ERmpqqw3 dUnFW02MetL4jeX846PyXp18Mw8mpmhEKTjnL7nc/ESasNBCyYoHwP0NaaNW2w== 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 45BF11A9FD; Sat, 23 Apr 2022 23:03:44 +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 23NN3iqi050817; Sat, 23 Apr 2022 23:03:44 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23NN3iwX050816; Sat, 23 Apr 2022 23:03:44 GMT (envelope-from git) Date: Sat, 23 Apr 2022 23:03:44 GMT Message-Id: <202204232303.23NN3iwX050816@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: 15e0215800fb - stable/13 - cam: don't send scsi commands on shutdown when reboot method RB_NOSYNC List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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: 15e0215800fbda50e841d6f94d7dfc853174941b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650755024; 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=82JKPrlm6U2wxXAi5tp4StSY1O96RaSqUZvWqAIGGPk=; b=sHToIdODw0om1EE0VYu/A3DCQvDbfefma/1X6a/3khUttikl1/H4fi1myM31bxFkej3Tyu 6yju/t2AeONSnJKRatlnCA1oIJLtuAREucnP6sNwHBP7e9nUoGIumZuOoWm9XEdEOSG2G3 ri1L2VHOtqhNjZBXtWTBnNdnHpH0CDOACvnq2+3J+YhY3p0Z32W3/gCw6ldhAuGvVR/U3h JnF90fMLHYIHIIK+hHTD/yOrNx+/s5nhlErTqMCORSgLbW4R9PsC3hEBRbwdd+bSb5JBZ5 nLX5ieT0pWXTtaqWpuxWSPrFhehIy+Xxy7orvUWM272q6AAq/Z4w/svtKDcoKg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650755024; a=rsa-sha256; cv=none; b=GBFkm+du4YjvvM3KkW0Hg0AwQxQGqSLuJ/SW1aD8ceajSpFJXdOMlIMStULL8O2SuIShJc WlolT3q1xBVXhV6lH3RkVIXzyGrft6v4ShLs7odYHEDJx4oAaKv98lvE5HZeCV+RSwJjkL oLU7Mdhih19hhAJNH0/bPPWtM8vLAsLeB9UBjTKmeL3J17XjsnNMtRrGZTKX9FWRzCsoIt bnzdgh42NMx30LkhNkzO+atMGCcXGFpf3owo25jGjoGh2VzzLRH+Ignz4qdwrMRsv1vX3X KiVXuoUwwF40qPw9NqRxh65DPa12f4hZ1PmbZrjNuA/mVEKadi288utfLDUj+Q== 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=15e0215800fbda50e841d6f94d7dfc853174941b commit 15e0215800fbda50e841d6f94d7dfc853174941b Author: Wojciech Macek AuthorDate: 2021-12-20 05:32:51 +0000 Commit: Alexander Motin CommitDate: 2022-04-23 23:03:22 +0000 cam: don't send scsi commands on shutdown when reboot method RB_NOSYNC Don't send the SCSI comand SYNCHRONIZE CACHE on devices that are still open when RB_NOSYNC is the reboot method. This may avoid recursive panics when doadump is called due to a SCSI/CAM/USB error/bug. Obtained from: Semihalf Sponsored by: Stormshield Reviewed by: imp Differential revision: https://reviews.freebsd.org/D31549 (cherry picked from commit e0ceec676dc86ddca960a9858ae5e3a4e0c8390d) --- sys/cam/scsi/scsi_da.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 8b1e1c0e0d46..a8a7e34bf6f0 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -6241,6 +6242,9 @@ dashutdown(void * arg, int howto) union ccb *ccb; int error; + if ((howto & RB_NOSYNC) != 0) + return; + CAM_PERIPH_FOREACH(periph, &dadriver) { softc = (struct da_softc *)periph->softc; if (SCHEDULER_STOPPED()) {