Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 15 Feb 2019 11:28:32 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r344156 - stable/11/sys/fs/nullfs
Message-ID:  <201902151128.x1FBSW2Z055586@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Fri Feb 15 11:28:32 2019
New Revision: 344156
URL: https://svnweb.freebsd.org/changeset/base/344156

Log:
  MFC r343899:
  In null_vptocnp(), cache vp->v_mount and use it for null_nodeget() call.
  
  PR:	235549

Modified:
  stable/11/sys/fs/nullfs/null_vnops.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/sys/fs/nullfs/null_vnops.c
==============================================================================
--- stable/11/sys/fs/nullfs/null_vnops.c	Fri Feb 15 11:27:21 2019	(r344155)
+++ stable/11/sys/fs/nullfs/null_vnops.c	Fri Feb 15 11:28:32 2019	(r344156)
@@ -868,11 +868,14 @@ null_vptocnp(struct vop_vptocnp_args *ap)
 	struct vnode **dvp = ap->a_vpp;
 	struct vnode *lvp, *ldvp;
 	struct ucred *cred = ap->a_cred;
+	struct mount *mp;
 	int error, locked;
 
 	locked = VOP_ISLOCKED(vp);
 	lvp = NULLVPTOLOWERVP(vp);
 	vhold(lvp);
+	mp = vp->v_mount;
+	vfs_ref(mp);
 	VOP_UNLOCK(vp, 0); /* vp is held by vn_vptocnp_locked that called us */
 	ldvp = lvp;
 	vref(lvp);
@@ -880,6 +883,7 @@ null_vptocnp(struct vop_vptocnp_args *ap)
 	vdrop(lvp);
 	if (error != 0) {
 		vn_lock(vp, locked | LK_RETRY);
+		vfs_rel(mp);
 		return (ENOENT);
 	}
 
@@ -891,9 +895,10 @@ null_vptocnp(struct vop_vptocnp_args *ap)
 	if (error != 0) {
 		vrele(ldvp);
 		vn_lock(vp, locked | LK_RETRY);
+		vfs_rel(mp);
 		return (ENOENT);
 	}
-	error = null_nodeget(vp->v_mount, ldvp, dvp);
+	error = null_nodeget(mp, ldvp, dvp);
 	if (error == 0) {
 #ifdef DIAGNOSTIC
 		NULLVPTOLOWERVP(*dvp);
@@ -901,6 +906,7 @@ null_vptocnp(struct vop_vptocnp_args *ap)
 		VOP_UNLOCK(*dvp, 0); /* keep reference on *dvp */
 	}
 	vn_lock(vp, locked | LK_RETRY);
+	vfs_rel(mp);
 	return (error);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201902151128.x1FBSW2Z055586>