summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorrdivacky <rdivacky@FreeBSD.org>2008-04-29 21:40:11 +0000
committerrdivacky <rdivacky@FreeBSD.org>2008-04-29 21:40:11 +0000
commit2db61d77e97b931741d0f7a95ff095773a62cf69 (patch)
tree1ab1d5746ab13c99b08b4c5ca4f737836f9d8f76 /sys
parent8bf6f34fe9c6c60622d316bf23d8e06354f0f1ab (diff)
downloadFreeBSD-src-2db61d77e97b931741d0f7a95ff095773a62cf69.zip
FreeBSD-src-2db61d77e97b931741d0f7a95ff095773a62cf69.tar.gz
Lock filedesc exclusively when modifying fd_[cr]dir.
This is probably harmless but it's better to lock it correctly. Approved by: kib (mentor)
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/vfs_mount.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 34166e7..7ba181d 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -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);
OpenPOWER on IntegriCloud