summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormjg <mjg@FreeBSD.org>2014-03-21 01:34:19 +0000
committermjg <mjg@FreeBSD.org>2014-03-21 01:34:19 +0000
commit103a66d7d0553e822a2a6ca43656f23d0065a126 (patch)
treede2539cc9a5eac0bee3ceeb6936559872f4b6a8c
parent3779db6b3fdd08fc12c9fe47e67a77e8c31e65b7 (diff)
downloadFreeBSD-src-103a66d7d0553e822a2a6ca43656f23d0065a126.zip
FreeBSD-src-103a66d7d0553e822a2a6ca43656f23d0065a126.tar.gz
Take filedesc lock only for reading when allocating new fdtable.
Code populating the table does this already. MFC after: 1 week
-rw-r--r--sys/kern/kern_descrip.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c
index 2bf7382..0a9e2f9 100644
--- a/sys/kern/kern_descrip.c
+++ b/sys/kern/kern_descrip.c
@@ -1808,7 +1808,7 @@ fdinit(struct filedesc *fdp)
newfdp = malloc(sizeof *newfdp, M_FILEDESC, M_WAITOK | M_ZERO);
FILEDESC_LOCK_INIT(&newfdp->fd_fd);
if (fdp != NULL) {
- FILEDESC_XLOCK(fdp);
+ FILEDESC_SLOCK(fdp);
newfdp->fd_fd.fd_cdir = fdp->fd_cdir;
if (newfdp->fd_fd.fd_cdir)
VREF(newfdp->fd_fd.fd_cdir);
@@ -1818,7 +1818,7 @@ fdinit(struct filedesc *fdp)
newfdp->fd_fd.fd_jdir = fdp->fd_jdir;
if (newfdp->fd_fd.fd_jdir)
VREF(newfdp->fd_fd.fd_jdir);
- FILEDESC_XUNLOCK(fdp);
+ FILEDESC_SUNLOCK(fdp);
}
/* Create the file descriptor table. */
OpenPOWER on IntegriCloud