Take filedesc lock only for reading when allocating new fdtable.
Code populating the table does this already. MFC after: 1 week
This commit is contained in:
parent
2df503a63a
commit
4c73e705a5
@ -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. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user