Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Aug 2009 09:27:10 +0000 (UTC)
From:      Pawel Jakub Dawidek <pjd@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r196302 - in stable/8/sys: . amd64/include/xen cddl/contrib/opensolaris cddl/contrib/opensolaris/uts/common/fs/zfs contrib/dev/acpica contrib/pf dev/ata dev/cxgb dev/mfi dev/xen/netfron...
Message-ID:  <200908170927.n7H9RAlx057065@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pjd
Date: Mon Aug 17 09:27:10 2009
New Revision: 196302
URL: http://svn.freebsd.org/changeset/base/196302

Log:
  MFC r196301:
  
  If z_buf is NULL, we should free znode immediately.
  
  Noticed by:	avg
  Approved by:	re (kib)

Modified:
  stable/8/sys/   (props changed)
  stable/8/sys/amd64/include/xen/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
  stable/8/sys/contrib/dev/acpica/   (props changed)
  stable/8/sys/contrib/pf/   (props changed)
  stable/8/sys/dev/ata/   (props changed)
  stable/8/sys/dev/cxgb/   (props changed)
  stable/8/sys/dev/mfi/   (props changed)
  stable/8/sys/dev/xen/netfront/   (props changed)
  stable/8/sys/dev/xen/xenpci/   (props changed)
  stable/8/sys/modules/dtrace/dtnfsclient/   (props changed)
  stable/8/sys/modules/ip6_mroute_mod/   (props changed)
  stable/8/sys/modules/ipmi/ipmi_linux/   (props changed)
  stable/8/sys/netinet/ipfw/ip_dummynet.c   (props changed)
  stable/8/sys/netinet/ipfw/ip_fw2.c   (props changed)
  stable/8/sys/netinet/ipfw/ip_fw_nat.c   (props changed)
  stable/8/sys/netinet/ipfw/ip_fw_pfil.c   (props changed)
  stable/8/sys/netipx/spx_reass.c   (props changed)
  stable/8/sys/xen/evtchn.h   (props changed)
  stable/8/sys/xen/hypervisor.h   (props changed)
  stable/8/sys/xen/xen_intr.h   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Mon Aug 17 09:25:37 2009	(r196301)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c	Mon Aug 17 09:27:10 2009	(r196302)
@@ -4350,7 +4350,6 @@ zfs_freebsd_reclaim(ap)
 {
 	vnode_t	*vp = ap->a_vp;
 	znode_t	*zp = VTOZ(vp);
-	zfsvfs_t *zfsvfs;
 
 	ASSERT(zp != NULL);
 
@@ -4360,13 +4359,18 @@ zfs_freebsd_reclaim(ap)
 	vnode_destroy_vobject(vp);
 
 	mutex_enter(&zp->z_lock);
-	ASSERT(zp->z_phys);
+	ASSERT(zp->z_phys != NULL);
 	ZTOV(zp) = NULL;
-	if (!zp->z_unlinked) {
+	mutex_exit(&zp->z_lock);
+
+	if (zp->z_unlinked)
+		;	/* Do nothing. */
+	else if (zp->z_dbuf == NULL)
+		zfs_znode_free(zp);
+	else /* if (!zp->z_unlinked && zp->z_dbuf != NULL) */ {
+		zfsvfs_t *zfsvfs = zp->z_zfsvfs;
 		int locked;
 
-		zfsvfs = zp->z_zfsvfs;
-		mutex_exit(&zp->z_lock);
 		locked = MUTEX_HELD(ZFS_OBJ_MUTEX(zfsvfs, zp->z_id)) ? 2 :
 		    ZFS_OBJ_HOLD_TRYENTER(zfsvfs, zp->z_id);
 		if (locked == 0) {
@@ -4382,8 +4386,6 @@ zfs_freebsd_reclaim(ap)
 				ZFS_OBJ_HOLD_EXIT(zfsvfs, zp->z_id);
 			zfs_znode_free(zp);
 		}
-	} else {
-		mutex_exit(&zp->z_lock);
 	}
 	VI_LOCK(vp);
 	vp->v_data = NULL;



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