From nobody Tue Jun 21 12:43:57 2022 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 712F5871308; Tue, 21 Jun 2022 12:43:57 +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 4LS5mY1pJxz3pd2; Tue, 21 Jun 2022 12:43:57 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655815437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eN14t99JFUHO6zCVPFWHT46QCVdUJPn8JAZgFLbKTg0=; b=Q9Pcz2R32oY+aUVqU6cbEdvSCBqmxdOdhVWfDqNBBoi9HQ6tjSB7ngn3CHplNnErflOGkT DXJ7ptz0oLNjuzkQZ5m+EsrcKCJ7et5yTqiyypouLRsmCPQx8UpZF52Gz/Dwzsl4xHLBXU Z7o6nC9lIoGO2K7CddpcWhBpvWbBSLqWWEPJJl4Tqj7hLkLpLhWpn+2PebfjYxDWnKkPCu wdq1Nhi7oUb9FRB+4nAbg/7FxFC20hMvSHH//JQLsH8WNsIhEWYGuFvvcX9VhuhYDUpYKy MLX28IYoI7UYQ1ga4SEK0+AYTBEGTIo5evhpx8MIsIbVgXdPU60QsclDnfvEzw== 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 1F5B1120E7; Tue, 21 Jun 2022 12:43:57 +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 25LChvFB045872; Tue, 21 Jun 2022 12:43:57 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 25LChvSI045871; Tue, 21 Jun 2022 12:43:57 GMT (envelope-from git) Date: Tue, 21 Jun 2022 12:43:57 GMT Message-Id: <202206211243.25LChvSI045871@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: 60dc4909a896 - stable/13 - null_vptocnp(): busy nullfs mp instead of refing it List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org 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/stable/13 X-Git-Reftype: branch X-Git-Commit: 60dc4909a8969be38ca2bc60e9f9c8eeb62c7624 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1655815437; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=eN14t99JFUHO6zCVPFWHT46QCVdUJPn8JAZgFLbKTg0=; b=bbt/mXhWwgtW/hEn2K+gj/qvpeOUxRsAacIZp1+ieUrjFeH2/ar4NFNN5NupdmEMK7QxVC h+0LwnJy7owjI3AY6WivNvi0TiU+7e9gC1+sKrOzFyrgALX3tK3dMVLqriASSSjQWUhleb evU2bHb6RBZEQKPHVuOHc+zQDZYazmO+Boh9exfJ/Cf1INNJSAOvDDF32mQ+9lXKlNRS6O p31c2R707UHqg7jRQ+A5znTFWTNib/60M6sU4Uh6L8OVyzClGOUYfSwEoCrpt7aGrFWSI9 VtuSrRg0GGiNdGOeDx/+MIldLsGI9s7SwLCqFVAR5F4BJQaa4pu7kfRUtAGQrA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1655815437; a=rsa-sha256; cv=none; b=n7i0uq/xlp8Nye0GILz/m9Io2KlTbAl4NDk8uL3lma0GY8orYXEGo86yBx2aZIvLzwS2YJ 6AfFwl1OJoh9HJM71K3Ndonr3Alj9OkwSas8QdobsJLR7dH5AmBeNNT/RQ914EbcH6yNM6 NhlsI2dpe1BsePkQEjbXVuZl1b/0yA9vnmDZ0CQ+Be/rZxYuzT52vpvlr72mS0qsXgqb5u nMd+GdN58ttIqothpoz/51/5x4X4BttPt316p3+Vaa6bL1r7QTGshquevvoMn1+ahdYFN6 7Yc0GBPWMT0oXEnSZaoFqsQu5LQHuyoVzuFKuUQi8/HI9UpMK+OdjwSH7eB6zw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=60dc4909a8969be38ca2bc60e9f9c8eeb62c7624 commit 60dc4909a8969be38ca2bc60e9f9c8eeb62c7624 Author: Konstantin Belousov AuthorDate: 2022-06-10 11:35:45 +0000 Commit: Konstantin Belousov CommitDate: 2022-06-21 12:43:38 +0000 null_vptocnp(): busy nullfs mp instead of refing it (cherry picked from commit 7fd37611b92b5f365f33435bb725b335c2f10ba8) --- sys/fs/nullfs/null_vnops.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index e3a320a22bfa..bb18bc8ee55f 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -989,9 +989,11 @@ null_vptocnp(struct vop_vptocnp_args *ap) locked = VOP_ISLOCKED(vp); lvp = NULLVPTOLOWERVP(vp); - vhold(lvp); mp = vp->v_mount; - vfs_ref(mp); + error = vfs_busy(mp, MBF_NOWAIT); + if (error != 0) + return (error); + vhold(lvp); VOP_UNLOCK(vp); /* vp is held by vn_vptocnp_locked that called us */ ldvp = lvp; vref(lvp); @@ -999,7 +1001,7 @@ null_vptocnp(struct vop_vptocnp_args *ap) vdrop(lvp); if (error != 0) { vn_lock(vp, locked | LK_RETRY); - vfs_rel(mp); + vfs_unbusy(mp); return (ENOENT); } @@ -1007,7 +1009,7 @@ null_vptocnp(struct vop_vptocnp_args *ap) if (error != 0) { vrele(ldvp); vn_lock(vp, locked | LK_RETRY); - vfs_rel(mp); + vfs_unbusy(mp); return (ENOENT); } error = null_nodeget(mp, ldvp, dvp); @@ -1018,7 +1020,7 @@ null_vptocnp(struct vop_vptocnp_args *ap) VOP_UNLOCK(*dvp); /* keep reference on *dvp */ } vn_lock(vp, locked | LK_RETRY); - vfs_rel(mp); + vfs_unbusy(mp); return (error); }