Lock filedesc exclusively when modifying fd_[cr]dir.
This is probably harmless but it's better to lock it correctly. Approved by: kib (mentor)
This commit is contained in:
parent
3971d07be7
commit
d6891277a4
@ -1472,7 +1472,7 @@ set_rootvnode(struct thread *td)
|
||||
panic("Cannot find root vnode");
|
||||
|
||||
p = td->td_proc;
|
||||
FILEDESC_SLOCK(p->p_fd);
|
||||
FILEDESC_XLOCK(p->p_fd);
|
||||
|
||||
if (p->p_fd->fd_cdir != NULL)
|
||||
vrele(p->p_fd->fd_cdir);
|
||||
@ -1484,7 +1484,7 @@ set_rootvnode(struct thread *td)
|
||||
p->p_fd->fd_rdir = rootvnode;
|
||||
VREF(rootvnode);
|
||||
|
||||
FILEDESC_SUNLOCK(p->p_fd);
|
||||
FILEDESC_XUNLOCK(p->p_fd);
|
||||
|
||||
VOP_UNLOCK(rootvnode, 0);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user