summaryrefslogtreecommitdiffstats
path: root/sys/cddl
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2011-08-24 22:07:38 +0000
committerpjd <pjd@FreeBSD.org>2011-08-24 22:07:38 +0000
commit173bc8ca15a262be1199b83297414d44fa3d0a56 (patch)
tree8d7edb0c68561c51ce713d4d891ca4425e8d43d7 /sys/cddl
parent6a7906318730de9b42a49050eb3f9fa3b476812b (diff)
downloadFreeBSD-src-173bc8ca15a262be1199b83297414d44fa3d0a56.zip
FreeBSD-src-173bc8ca15a262be1199b83297414d44fa3d0a56.tar.gz
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
Diffstat (limited to 'sys/cddl')
-rw-r--r--sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
index 29ca446..0fcc850 100644
--- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
+++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_znode.c
@@ -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_buf_t *db, int blksz,
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);
}
OpenPOWER on IntegriCloud