mirror of
https://github.com/freebsd/freebsd-src
synced 2024-10-18 14:23:55 +00:00
Move a FILEDESC_UNLOCK up to maintain correct nesting of FILEDESC/FILE
locking.
This commit is contained in:
parent
9bb4281603
commit
dc99052535
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=137769
|
@ -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);
|
||||
if (fp != NULL) {
|
||||
/*
|
||||
* We now own the reference to fp that the ofiles[] array
|
||||
* used to own. Release it.
|
||||
* We now own the reference to fp that the ofiles[]
|
||||
* array used to own. Release it.
|
||||
*/
|
||||
if (fp != NULL)
|
||||
FILE_LOCK(fp);
|
||||
fdrop_locked(fp, td);
|
||||
}
|
||||
return (0);
|
||||
|
||||
case ENXIO:
|
||||
|
|
Loading…
Reference in a new issue