From owner-dev-commits-src-all@freebsd.org Mon Mar 22 22:51:55 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 192A25BCED1; Mon, 22 Mar 2021 22:51:55 +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 4F48rW00sgz4rkd; Mon, 22 Mar 2021 22:51:55 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 DDDC215E64; Mon, 22 Mar 2021 22:51:54 +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 12MMpsSp071512; Mon, 22 Mar 2021 22:51:54 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12MMpsAu071511; Mon, 22 Mar 2021 22:51:54 GMT (envelope-from git) Date: Mon, 22 Mar 2021 22:51:54 GMT Message-Id: <202103222251.12MMpsAu071511@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: John Baldwin Subject: git: 9df8f5a9c684 - stable/13 - cam: Don't permit crashdumps on non-pollable devices. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 9df8f5a9c684358e1cf713cb85aa72416d92af48 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Mar 2021 22:51:55 -0000 The branch stable/13 has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=9df8f5a9c684358e1cf713cb85aa72416d92af48 commit 9df8f5a9c684358e1cf713cb85aa72416d92af48 Author: John Baldwin AuthorDate: 2021-02-11 21:51:01 +0000 Commit: John Baldwin CommitDate: 2021-03-22 20:37:38 +0000 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. Sponsored by: Chelsio (cherry picked from commit e07ac3f2fd7336e04178d116033989a6c099fec4) --- sys/cam/ata/ata_da.c | 3 ++- sys/cam/nvme/nvme_da.c | 3 ++- sys/cam/scsi/scsi_da.c | 5 +++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/sys/cam/ata/ata_da.c b/sys/cam/ata/ata_da.c index a34df577174c..38d996510f98 100644 --- a/sys/cam/ata/ata_da.c +++ b/sys/cam/ata/ata_da.c @@ -1880,7 +1880,8 @@ adaregister(struct cam_periph *periph, void *arg) softc->disk->d_close = adaclose; softc->disk->d_strategy = adastrategy; softc->disk->d_getattr = adagetattr; - softc->disk->d_dump = adadump; + if (cam_sim_pollable(periph->sim)) + softc->disk->d_dump = adadump; softc->disk->d_gone = adadiskgonecb; softc->disk->d_name = "ada"; softc->disk->d_drv1 = periph; 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; diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 73e5e0c3e14c..c13b51921745 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";