From e1368281617250669e2ed9ff90355b40873c38f1 Mon Sep 17 00:00:00 2001 From: pjd Date: Tue, 1 May 2007 13:58:56 +0000 Subject: [PATCH] MFp4: Remove LK_RETRY flag when locking vnode in zfs_lookup, we don't want dead vnodes here. Suggested by: kib --- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 7 ++++++- sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index a4174b9cee8f..bcf5ca76a83e 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -1109,9 +1109,14 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct componentname *cnp, if (error == 0 && (nm[0] != '.' || nm[1] != '\0')) { if (cnp->cn_flags & ISDOTDOT) VOP_UNLOCK(dvp, 0, td); - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td); + error = vn_lock(*vpp, LK_EXCLUSIVE, td); if (cnp->cn_flags & ISDOTDOT) vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + if (error != 0) { + VN_RELE(*vpp); + *vpp = NULL; + return (error); + } } #ifdef FREEBSD_NAMECACHE diff --git a/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c b/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c index a4174b9cee8f..bcf5ca76a83e 100644 --- a/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -1109,9 +1109,14 @@ zfs_lookup(vnode_t *dvp, char *nm, vnode_t **vpp, struct componentname *cnp, if (error == 0 && (nm[0] != '.' || nm[1] != '\0')) { if (cnp->cn_flags & ISDOTDOT) VOP_UNLOCK(dvp, 0, td); - vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY, td); + error = vn_lock(*vpp, LK_EXCLUSIVE, td); if (cnp->cn_flags & ISDOTDOT) vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + if (error != 0) { + VN_RELE(*vpp); + *vpp = NULL; + return (error); + } } #ifdef FREEBSD_NAMECACHE