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:
Roman Divacky 2008-04-29 21:40:11 +00:00
parent 3971d07be7
commit d6891277a4

View File

@ -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);