From owner-svn-src-head@freebsd.org Tue Jan 9 00:17:16 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D3B2BE6DEE0; Tue, 9 Jan 2018 00:17:16 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF9777CBA2; Tue, 9 Jan 2018 00:17:16 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id EA858730F; Tue, 9 Jan 2018 00:17:15 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w090HFCO074104; Tue, 9 Jan 2018 00:17:15 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w090HFkx074103; Tue, 9 Jan 2018 00:17:15 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201801090017.w090HFkx074103@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: scottl set sender to scottl@FreeBSD.org using -f From: Scott Long Date: Tue, 9 Jan 2018 00:17:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327711 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 327711 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Jan 2018 00:17:16 -0000 Author: scottl Date: Tue Jan 9 00:17:15 2018 New Revision: 327711 URL: https://svnweb.freebsd.org/changeset/base/327711 Log: Don't hold the periph locks during dump. Obtained from: Netflix Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Tue Jan 9 00:10:59 2018 (r327710) +++ head/sys/cam/nvme/nvme_da.c Tue Jan 9 00:17:15 2018 (r327711) @@ -388,15 +388,12 @@ ndadump(void *arg, void *virtual, vm_offset_t physical dp = arg; periph = dp->d_drv1; softc = (struct nda_softc *)periph->softc; - cam_periph_lock(periph); secsize = softc->disk->d_sectorsize; lba = offset / secsize; count = length / secsize; - if ((periph->flags & CAM_PERIPH_INVALID) != 0) { - cam_periph_unlock(periph); + if ((periph->flags & CAM_PERIPH_INVALID) != 0) return (ENXIO); - } /* xpt_get_ccb returns a zero'd allocation for the ccb, mimic that here */ memset(&nvmeio, 0, sizeof(nvmeio)); @@ -408,7 +405,6 @@ ndadump(void *arg, void *virtual, vm_offset_t physical 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) printf("Aborting dump due to I/O error %d.\n", error); - cam_periph_unlock(periph); return (error); } @@ -422,7 +418,6 @@ ndadump(void *arg, void *virtual, vm_offset_t physical 0, SF_NO_RECOVERY | SF_NO_RETRY, NULL); if (error != 0) xpt_print(periph->path, "flush cmd failed\n"); - cam_periph_unlock(periph); return (error); }