svn commit: r225153 -
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Pawel Jakub Dawidek
pjd at FreeBSD.org
Wed Aug 24 22:07:39 UTC 2011
Author: pjd
Date: Wed Aug 24 22:07:38 2011
New Revision: 225153
URL: http://svn.freebsd.org/changeset/base/225153
Log:
We need to unlock and destroy vnode attached to znode which we are freeing.
Reviewed by: kib
Approved by: re (bz)
MFC after: 1 week
Modified:
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Aug 24 20:05:13 2011 (r225152)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c Wed Aug 24 22:07:38 2011 (r225153)
@@ -627,6 +627,18 @@ zfs_znode_dmu_fini(znode_t *zp)
zp->z_sa_hdl = NULL;
}
+static void
+zfs_vnode_forget(vnode_t *vp)
+{
+
+ VOP_UNLOCK(vp, 0);
+ VI_LOCK(vp);
+ vp->v_usecount--;
+ vp->v_iflag |= VI_DOOMED;
+ vp->v_data = NULL;
+ vdropl(vp);
+}
+
/*
* Construct a new znode/vnode and intialize.
*
@@ -688,6 +700,8 @@ zfs_znode_alloc(zfsvfs_t *zfsvfs, dmu_bu
if (sa_bulk_lookup(zp->z_sa_hdl, bulk, count) != 0 || zp->z_gen == 0) {
if (hdl == NULL)
sa_handle_destroy(zp->z_sa_hdl);
+ zfs_vnode_forget(vp);
+ zp->z_vnode = NULL;
kmem_cache_free(znode_cache, zp);
return (NULL);
}
More information about the svn-src-all
mailing list