Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 14 Jun 2009 18:04:22 +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-7@freebsd.org
Subject:   svn commit: r194205 - in stable/7/sys: . contrib/pf dev/ath/ath_hal fs/pseudofs
Message-ID:  <200906141804.n5EI4MOO056333@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Sun Jun 14 18:04:22 2009
New Revision: 194205
URL: http://svn.freebsd.org/changeset/base/194205

Log:
  MFC r193176:
  Unlock the pseudofs vnode before calling fill method for pfs_readlink().

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/fs/pseudofs/pseudofs_vnops.c

Modified: stable/7/sys/fs/pseudofs/pseudofs_vnops.c
==============================================================================
--- stable/7/sys/fs/pseudofs/pseudofs_vnops.c	Sun Jun 14 18:01:35 2009	(r194204)
+++ stable/7/sys/fs/pseudofs/pseudofs_vnops.c	Sun Jun 14 18:04:22 2009	(r194205)
@@ -746,9 +746,10 @@ pfs_readlink(struct vop_readlink_args *v
 	struct pfs_node *pn = pvd->pvd_pn;
 	struct uio *uio = va->a_uio;
 	struct proc *proc = NULL;
+	struct thread *td = curthread;
 	char buf[PATH_MAX];
 	struct sbuf sb;
-	int error;
+	int error, locked;
 
 	PFS_TRACE(("%s", pn->pn_name));
 	pfs_assert_not_owned(pn);
@@ -770,14 +771,19 @@ pfs_readlink(struct vop_readlink_args *v
 		_PHOLD(proc);
 		PROC_UNLOCK(proc);
 	}
+	vhold(vn);
+	locked = VOP_ISLOCKED(vn, td);
+	VOP_UNLOCK(vn, 0, td);
 
 	/* sbuf_new() can't fail with a static buffer */
 	sbuf_new(&sb, buf, sizeof buf, 0);
 
-	error = pn_fill(curthread, proc, pn, &sb, NULL);
+	error = pn_fill(td, proc, pn, &sb, NULL);
 
 	if (proc != NULL)
 		PRELE(proc);
+	vn_lock(vn, locked | LK_RETRY, td);
+	vdrop(vn);
 
 	if (error) {
 		sbuf_delete(&sb);



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