diff options
author | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2007-05-02 00:41:44 +0000 |
---|---|---|
committer | Pawel Jakub Dawidek <pjd@FreeBSD.org> | 2007-05-02 00:41:44 +0000 |
commit | 5bec66402b17345debeb34c5ae8ac67258b01b96 (patch) | |
tree | 165b0d16befe35ea2b412eeb1ae58afb49446c8a /sys/cddl | |
parent | 9167141244060875ea1ba48a8b532033f0599f71 (diff) | |
download | src-5bec66402b17345debeb34c5ae8ac67258b01b96.tar.gz src-5bec66402b17345debeb34c5ae8ac67258b01b96.zip |
When parent directory has to be unlocked, lock it back with the same lock
type. Before this change, if directory was shared-locked, it was relocked
exclusively.
Notes
Notes:
svn path=/head/; revision=169198
Diffstat (limited to 'sys/cddl')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c | 8 |
1 files changed, 6 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 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; |