From owner-svn-src-head@freebsd.org Tue Jan 9 21:23:17 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 816DBE7395D; Tue, 9 Jan 2018 21:23:17 +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 56BDB7205B; Tue, 9 Jan 2018 21:23:17 +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 5F6F41C749; Tue, 9 Jan 2018 21:23:16 +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 w09LNGXP011540; Tue, 9 Jan 2018 21:23:16 GMT (envelope-from scottl@FreeBSD.org) Received: (from scottl@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w09LNGV1011539; Tue, 9 Jan 2018 21:23:16 GMT (envelope-from scottl@FreeBSD.org) Message-Id: <201801092123.w09LNGV1011539@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 21:23:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r327741 - head/sys/cam X-SVN-Group: head X-SVN-Commit-Author: scottl X-SVN-Commit-Paths: head/sys/cam X-SVN-Commit-Revision: 327741 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 21:23:17 -0000 Author: scottl Date: Tue Jan 9 21:23:16 2018 New Revision: 327741 URL: https://svnweb.freebsd.org/changeset/base/327741 Log: Hold a refcount on the periph while running the allocation queue. This will allow sub-transports to release their probe pseudo-device with fewer convoluted restrictions. Obtained from: Netflix Modified: head/sys/cam/cam_xpt.c Modified: head/sys/cam/cam_xpt.c ============================================================================== --- head/sys/cam/cam_xpt.c Tue Jan 9 21:12:53 2018 (r327740) +++ head/sys/cam/cam_xpt.c Tue Jan 9 21:23:16 2018 (r327741) @@ -3383,6 +3383,7 @@ xpt_run_allocq(struct cam_periph *periph, int sleep) cam_periph_assert(periph, MA_OWNED); if (periph->periph_allocating) return; + cam_periph_doacquire(periph); periph->periph_allocating = 1; CAM_DEBUG_PRINT(CAM_DEBUG_XPT, ("xpt_run_allocq(%p)\n", periph)); device = periph->path->device; @@ -3426,6 +3427,7 @@ restart: if (ccb != NULL) xpt_release_ccb(ccb); periph->periph_allocating = 0; + cam_periph_release_locked(periph); } static void