aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/scsi/scsi_da.c
diff options
context:
space:
mode:
authorWojciech Macek <wma@FreeBSD.org>2021-12-20 05:32:51 +0000
committerWojciech Macek <wma@FreeBSD.org>2021-12-20 05:32:51 +0000
commite0ceec676dc86ddca960a9858ae5e3a4e0c8390d (patch)
tree91bee3d927c6e730b995e6077999185158a68d44 /sys/cam/scsi/scsi_da.c
parent4f741801d86089a1c5d631ba1e0f1421cdcf7a7e (diff)
downloadsrc-e0ceec676dc86ddca960a9858ae5e3a4e0c8390d.tar.gz
src-e0ceec676dc86ddca960a9858ae5e3a4e0c8390d.zip
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
Diffstat (limited to 'sys/cam/scsi/scsi_da.c')
-rw-r--r--sys/cam/scsi/scsi_da.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 0bcbccc7eab9..243e86d18caa 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$");
#include <sys/cons.h>
#include <sys/endian.h>
#include <sys/proc.h>
+#include <sys/reboot.h>
#include <sys/sbuf.h>
#include <geom/geom.h>
#include <geom/geom_disk.h>
@@ -6245,6 +6246,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()) {