From owner-dev-commits-src-all@freebsd.org Thu Feb 25 20:52:24 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 BC2EB56FA72; Thu, 25 Feb 2021 20:52:23 +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 4DmlN70mwrz3P2Z; Thu, 25 Feb 2021 20:52:23 +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 8BA8D1E548; Thu, 25 Feb 2021 20:52:19 +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 11PKqJSq079256; Thu, 25 Feb 2021 20:52:19 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 11PKqJXO079255; Thu, 25 Feb 2021 20:52:19 GMT (envelope-from git) Date: Thu, 25 Feb 2021 20:52:19 GMT Message-Id: <202102252052.11PKqJXO079255@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: 56119250bbfe - releng/13.0 - ffs_snapshot: use VOP_VPUT_PAIR after VOP_CREATE. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/releng/13.0 X-Git-Reftype: branch X-Git-Commit: 56119250bbfecee2121b309ecf7a61952c0c1998 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: Thu, 25 Feb 2021 20:52:25 -0000 The branch releng/13.0 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=56119250bbfecee2121b309ecf7a61952c0c1998 commit 56119250bbfecee2121b309ecf7a61952c0c1998 Author: Konstantin Belousov AuthorDate: 2021-01-24 13:56:05 +0000 Commit: Konstantin Belousov CommitDate: 2021-02-25 20:48:47 +0000 ffs_snapshot: use VOP_VPUT_PAIR after VOP_CREATE. Approved by: re (delphij, gjb) (cherry picked from commit be44e986377780f533f961fe7c009b93379b4710) --- sys/ufs/ffs/ffs_snapshot.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/sys/ufs/ffs/ffs_snapshot.c b/sys/ufs/ffs/ffs_snapshot.c index 32dc47653d18..b5daec14decf 100644 --- a/sys/ufs/ffs/ffs_snapshot.c +++ b/sys/ufs/ffs/ffs_snapshot.c @@ -296,16 +296,21 @@ restart: goto restart; } error = VOP_CREATE(nd.ni_dvp, &nd.ni_vp, &nd.ni_cnd, &vat); - VOP_UNLOCK(nd.ni_dvp); if (error) { + VOP_VPUT_PAIR(nd.ni_dvp, NULL, true); NDFREE(&nd, NDF_ONLY_PNBUF); vn_finished_write(wrtmp); - vrele(nd.ni_dvp); if (error == ERELOOKUP) goto restart; return (error); } vp = nd.ni_vp; + vref(nd.ni_dvp); + VOP_VPUT_PAIR(nd.ni_dvp, &vp, false); + if (VN_IS_DOOMED(vp)) { + error = EBADF; + goto out; + } vnode_create_vobject(nd.ni_vp, fs->fs_size, td); vp->v_vflag |= VV_SYSTEM; ip = VTOI(vp);