aboutsummaryrefslogtreecommitdiff
path: root/sys/cam/nvme
diff options
context:
space:
mode:
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/nvme
parent447b3557a9cc5f00a301be8404339f21a9a0faa8 (diff)
downloadsrc-e07ac3f2fd7336e04178d116033989a6c099fec4.tar.gz
src-e07ac3f2fd7336e04178d116033989a6c099fec4.zip
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/nvme')
-rw-r--r--sys/cam/nvme/nvme_da.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/cam/nvme/nvme_da.c b/sys/cam/nvme/nvme_da.c
index 8e7f7318ce3b..baeaad182f3a 100644
--- a/sys/cam/nvme/nvme_da.c
+++ b/sys/cam/nvme/nvme_da.c
@@ -898,7 +898,8 @@ ndaregister(struct cam_periph *periph, void *arg)
disk->d_strategy = ndastrategy;
disk->d_ioctl = ndaioctl;
disk->d_getattr = ndagetattr;
- disk->d_dump = ndadump;
+ if (cam_sim_pollable(periph->sim))
+ disk->d_dump = ndadump;
disk->d_gone = ndadiskgonecb;
disk->d_name = "nda";
disk->d_drv1 = periph;