diff options
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 8 | ||||
-rw-r--r-- | sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 8 |
2 files changed, 12 insertions, 4 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 95a1da705ee2..711321a10436 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,11 +1109,15 @@ 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) + int ltype = 0; + + if (cnp->cn_flags & ISDOTDOT) { + ltype = VOP_ISLOCKED(dvp, td); VOP_UNLOCK(dvp, 0, td); + } error = vn_lock(*vpp, cnp->cn_lkflags, td); if (cnp->cn_flags & ISDOTDOT) - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dvp, ltype | LK_RETRY, td); if (error != 0) { VN_RELE(*vpp); *vpp = NULL; 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 95a1da705ee2..711321a10436 100644 --- a/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c +++ b/sys/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c @@ -1109,11 +1109,15 @@ 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) + int ltype = 0; + + if (cnp->cn_flags & ISDOTDOT) { + ltype = VOP_ISLOCKED(dvp, td); VOP_UNLOCK(dvp, 0, td); + } error = vn_lock(*vpp, cnp->cn_lkflags, td); if (cnp->cn_flags & ISDOTDOT) - vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY, td); + vn_lock(dvp, ltype | LK_RETRY, td); if (error != 0) { VN_RELE(*vpp); *vpp = NULL; |