Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 18 Mar 2009 16:19:44 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r189967 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <200903181619.n2IGJifl031031@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Mar 18 16:19:44 2009
New Revision: 189967
URL: http://svn.freebsd.org/changeset/base/189967

Log:
  The zfs_get_xattrdir() function is used to find the extended attribute
  directory for a znode.  When the directory already exists, it returns a
  referenced but unlocked vnode.  When a directory does not yet exist, it
  calls zfs_make_xattrdir() to create a new one.  zfs_make_xattrdir() returns
  the vnode both referenced and and locked and zfs_get_xattrdir() was leaking
  this vnode lock to its callers.  Fix this by dropping the vnode lock if
  zfs_make_xattrdir() successfully creates a new extended attribute
  directory.
  
  Reviewed by:	pjd

Modified:
  head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c

Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c	Wed Mar 18 16:09:05 2009	(r189966)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_dir.c	Wed Mar 18 16:19:44 2009	(r189967)
@@ -940,6 +940,8 @@ top:
 		/* NB: we already did dmu_tx_wait() if necessary */
 		goto top;
 	}
+	if (error == 0)
+		VOP_UNLOCK(*xvpp, 0);
 
 	return (error);
 }



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