From owner-svn-src-head@freebsd.org Wed Feb 7 18:33:46 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BF79DF1B9A7; Wed, 7 Feb 2018 18:33:46 +0000 (UTC) (envelope-from imp@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 736D07786A; Wed, 7 Feb 2018 18:33:46 +0000 (UTC) (envelope-from imp@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 6E39928EA; Wed, 7 Feb 2018 18:33:46 +0000 (UTC) (envelope-from imp@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w17IXkwa049903; Wed, 7 Feb 2018 18:33:46 GMT (envelope-from imp@FreeBSD.org) Received: (from imp@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w17IXkDe049902; Wed, 7 Feb 2018 18:33:46 GMT (envelope-from imp@FreeBSD.org) Message-Id: <201802071833.w17IXkDe049902@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: imp set sender to imp@FreeBSD.org using -f From: Warner Losh Date: Wed, 7 Feb 2018 18:33:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r328983 - head/sys/cam/nvme X-SVN-Group: head X-SVN-Commit-Author: imp X-SVN-Commit-Paths: head/sys/cam/nvme X-SVN-Commit-Revision: 328983 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: Wed, 07 Feb 2018 18:33:46 -0000 Author: imp Date: Wed Feb 7 18:33:46 2018 New Revision: 328983 URL: https://svnweb.freebsd.org/changeset/base/328983 Log: Fix cut and pasted comments to reflect differences in code from the original source. Sponsored by: Netflix Modified: head/sys/cam/nvme/nvme_da.c Modified: head/sys/cam/nvme/nvme_da.c ============================================================================== --- head/sys/cam/nvme/nvme_da.c Wed Feb 7 18:32:51 2018 (r328982) +++ head/sys/cam/nvme/nvme_da.c Wed Feb 7 18:33:46 2018 (r328983) @@ -1094,19 +1094,25 @@ ndaflush(void) CAM_PERIPH_FOREACH(periph, &ndadriver) { softc = (struct nda_softc *)periph->softc; + if (SCHEDULER_STOPPED()) { - /* If we paniced with the lock held, do not recurse. */ + /* + * If we paniced with the lock held or the periph is not + * open, do not recurse. Otherwise, call ndadump since + * that avoids the sleeping cam_periph_getccb does if no + * CCBs are available. + */ if (!cam_periph_owned(periph) && (softc->flags & NDA_FLAG_OPEN)) { ndadump(softc->disk, NULL, 0, 0, 0); } continue; } - cam_periph_lock(periph); + /* - * We only sync the cache if the drive is still open, and - * if the drive is capable of it.. + * We only sync the cache if the drive is still open */ + cam_periph_lock(periph); if ((softc->flags & NDA_FLAG_OPEN) == 0) { cam_periph_unlock(periph); continue;