path: root/sys/cam/scsi/scsi_da.c
diff options
authorJohn Baldwin <jhb@FreeBSD.org>2021-02-11 21:51:01 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2021-02-11 21:52:18 +0000
commite07ac3f2fd7336e04178d116033989a6c099fec4 (patch)
treee5bc7982293b31512e953fdc2120baebcc6df5bf /sys/cam/scsi/scsi_da.c
parent447b3557a9cc5f00a301be8404339f21a9a0faa8 (diff)
cam: Don't permit crashdumps on non-pollable devices.
If a disk's SIM doesn't support polling, then it can't be used to store crashdumps. Leave d_dump NULL in that case so that dumpon(8) fails gracefully rather than having dumps fail at crash time. Reviewed by: scottl, mav, imp MFC after: 2 weeks Sponsored by: Chelsio Differential Revision: https://reviews.freebsd.org/D28454
Diffstat (limited to 'sys/cam/scsi/scsi_da.c')
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index 490f75336efd..e426fe07621b 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -2849,7 +2849,7 @@ daregister(struct cam_periph *periph, void *arg)
TASK_INIT(&softc->sysctl_task, 0, dasysctlinit, periph);
- * Take an exclusive section lock qon the periph while dastart is called
+ * Take an exclusive section lock on the periph while dastart is called
* to finish the probe. The lock will be dropped in dadone at the end
* of probe. This locks out daopen and daclose from racing with the
* probe.
@@ -2914,7 +2914,8 @@ daregister(struct cam_periph *periph, void *arg)
softc->disk->d_open = daopen;
softc->disk->d_close = daclose;
softc->disk->d_strategy = dastrategy;
- softc->disk->d_dump = dadump;
+ if (cam_sim_pollable(periph->sim))
+ softc->disk->d_dump = dadump;
softc->disk->d_getattr = dagetattr;
softc->disk->d_gone = dadiskgonecb;
softc->disk->d_name = "da";