Index: kern_descrip.c =================================================================== RCS file: /usr/ncvs/src/sys/kern/kern_descrip.c,v retrieving revision 1.294 diff -u -r1.294 kern_descrip.c --- kern_descrip.c 1 Apr 2006 11:09:54 -0000 1.294 +++ kern_descrip.c 15 Apr 2006 03:56:02 -0000 @@ -377,7 +377,6 @@ giant_locked = 1; mtx_lock(&Giant); } - error = 0; flg = F_POSIX; p = td->td_proc; @@ -390,10 +389,14 @@ goto done2; } pop = &fdp->fd_ofileflags[fd]; - + if (fp->f_type == DTYPE_VNODE) { + if (giant_locked != 0) { + mtx_unlock(&Giant); + giant_locked = 0; + } + } switch (cmd) { case F_DUPFD: - /* mtx_assert(&Giant, MA_NOTOWNED); */ FILEDESC_UNLOCK(fdp); newmin = arg; PROC_LOCK(p); @@ -408,20 +411,17 @@ break; case F_GETFD: - /* mtx_assert(&Giant, MA_NOTOWNED); */ td->td_retval[0] = (*pop & UF_EXCLOSE) ? FD_CLOEXEC : 0; FILEDESC_UNLOCK(fdp); break; case F_SETFD: - /* mtx_assert(&Giant, MA_NOTOWNED); */ *pop = (*pop &~ UF_EXCLOSE) | (arg & FD_CLOEXEC ? UF_EXCLOSE : 0); FILEDESC_UNLOCK(fdp); break; case F_GETFL: - /* mtx_assert(&Giant, MA_NOTOWNED); */ FILE_LOCK(fp); td->td_retval[0] = OFLAGS(fp->f_flag); FILE_UNLOCK(fp); @@ -429,7 +429,6 @@ break; case F_SETFL: - mtx_assert(&Giant, MA_OWNED); FILE_LOCK(fp); fhold_locked(fp); fp->f_flag &= ~FCNTLFLAGS; @@ -457,7 +456,6 @@ break; case F_GETOWN: - mtx_assert(&Giant, MA_OWNED); fhold(fp); FILEDESC_UNLOCK(fdp); error = fo_ioctl(fp, FIOGETOWN, &tmp, td->td_ucred, td); @@ -467,7 +465,6 @@ break; case F_SETOWN: - mtx_assert(&Giant, MA_OWNED); fhold(fp); FILEDESC_UNLOCK(fdp); tmp = arg; @@ -476,12 +473,10 @@ break; case F_SETLKW: - mtx_assert(&Giant, MA_OWNED); flg |= F_WAIT; /* FALLTHROUGH F_SETLK */ case F_SETLK: - mtx_assert(&Giant, MA_OWNED); if (fp->f_type != DTYPE_VNODE) { FILEDESC_UNLOCK(fdp); error = EBADF; @@ -555,7 +550,6 @@ break; case F_GETLK: - mtx_assert(&Giant, MA_OWNED); if (fp->f_type != DTYPE_VNODE) { FILEDESC_UNLOCK(fdp); error = EBADF;