diff options
author | phk <phk@FreeBSD.org> | 2004-11-15 16:10:55 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2004-11-15 16:10:55 +0000 |
commit | b9a3a171cc981341d15cfec685507aabefe0f7a9 (patch) | |
tree | b0f7cd4f1069509fa236aec5e902c0986968e1b6 /sys | |
parent | 0e1bc6bd7d8477826d2acd2c9387c6627a17300e (diff) | |
download | FreeBSD-src-b9a3a171cc981341d15cfec685507aabefe0f7a9.zip FreeBSD-src-b9a3a171cc981341d15cfec685507aabefe0f7a9.tar.gz |
Make FILE_LOCK and FILEDESC_LOCK nest properly by postponing the the
release of FILEDESC_LOCK a few more lines.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_descrip.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index 5a2f8df..1d1a22a 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -433,19 +433,19 @@ kern_fcntl(struct thread *td, int fd, int cmd, intptr_t arg) case F_GETFL: /* mtx_assert(&Giant, MA_NOTOWNED); */ FILE_LOCK(fp); - FILEDESC_UNLOCK(fdp); td->td_retval[0] = OFLAGS(fp->f_flag); FILE_UNLOCK(fp); + FILEDESC_UNLOCK(fdp); break; case F_SETFL: mtx_assert(&Giant, MA_OWNED); FILE_LOCK(fp); - FILEDESC_UNLOCK(fdp); fhold_locked(fp); fp->f_flag &= ~FCNTLFLAGS; fp->f_flag |= FFLAGS(arg & ~O_ACCMODE) & FCNTLFLAGS; FILE_UNLOCK(fp); + FILEDESC_UNLOCK(fdp); tmp = fp->f_flag & FNONBLOCK; error = fo_ioctl(fp, FIONBIO, &tmp, td->td_ucred, td); if (error) { |