In fchdir(), Giant must be separately acquired and dropped if the old
vnode is from a file system that is not MPSAFE, as vrele() expects Giant to be held when it is called on a non-MPSAFE vnode. Spotted by: kris Tested by: glebius
This commit is contained in:
parent
937a238777
commit
59428b0bad
@ -711,10 +711,12 @@ fchdir(td, uap)
|
||||
return (error);
|
||||
}
|
||||
VOP_UNLOCK(vp, 0, td);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
FILEDESC_LOCK_FAST(fdp);
|
||||
vpold = fdp->fd_cdir;
|
||||
fdp->fd_cdir = vp;
|
||||
FILEDESC_UNLOCK_FAST(fdp);
|
||||
vfslocked = VFS_LOCK_GIANT(vpold->v_mount);
|
||||
vrele(vpold);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
return (0);
|
||||
|
@ -711,10 +711,12 @@ fchdir(td, uap)
|
||||
return (error);
|
||||
}
|
||||
VOP_UNLOCK(vp, 0, td);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
FILEDESC_LOCK_FAST(fdp);
|
||||
vpold = fdp->fd_cdir;
|
||||
fdp->fd_cdir = vp;
|
||||
FILEDESC_UNLOCK_FAST(fdp);
|
||||
vfslocked = VFS_LOCK_GIANT(vpold->v_mount);
|
||||
vrele(vpold);
|
||||
VFS_UNLOCK_GIANT(vfslocked);
|
||||
return (0);
|
||||
|
Loading…
Reference in New Issue
Block a user