diff options
author | phk <phk@FreeBSD.org> | 2004-11-16 09:12:03 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-11-16 09:12:03 +0000 |
commit | 205866145eff75c19e34cdcdeafc112d85d87f16 (patch) | |
tree | e75f233cd0208e55b240301dd9f3d7dab63279af /sys | |
parent | 79449e034133e4446253c9d18f09f5f008fcf22f (diff) | |
download | FreeBSD-src-205866145eff75c19e34cdcdeafc112d85d87f16.zip FreeBSD-src-205866145eff75c19e34cdcdeafc112d85d87f16.tar.gz |
Move a FILEDESC_UNLOCK up to maintain correct nesting of FILEDESC/FILE
locking.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_descrip.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 1d1a22a..5ee38e8 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -1416,8 +1416,7 @@ falloc(td, resultfp, resultfd) * Free a file descriptor. */ void -ffree(fp) - struct file *fp; +ffree(struct file *fp) { KASSERT(fp->f_count == 0, ("ffree: fp_fcount not 0!")); @@ -1434,8 +1433,7 @@ ffree(fp) * Copy the current, root, and jail root vnode references. */ struct filedesc * -fdinit(fdp) - struct filedesc *fdp; +fdinit(struct filedesc *fdp) { struct filedesc0 *newfdp; @@ -2301,15 +2299,15 @@ dupfdopen(td, fdp, indx, dfd, mode, error) fdused(fdp, indx); fhold_locked(wfp); FILE_UNLOCK(wfp); - if (fp != NULL) - FILE_LOCK(fp); FILEDESC_UNLOCK(fdp); - /* - * We now own the reference to fp that the ofiles[] array - * used to own. Release it. - */ - if (fp != NULL) + if (fp != NULL) { + /* + * We now own the reference to fp that the ofiles[] + * array used to own. Release it. + */ + FILE_LOCK(fp); fdrop_locked(fp, td); + } return (0); case ENXIO: |