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.
This commit is contained in:
parent
9167141244
commit
5bec66402b
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=169198
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user