Date: Sun, 2 Nov 2014 01:13:12 +0000 (UTC) From: Mateusz Guzik <mjg@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r273956 - head/sys/kern Message-ID: <201411020113.sA21DCt9067713@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mjg Date: Sun Nov 2 01:13:11 2014 New Revision: 273956 URL: https://svnweb.freebsd.org/changeset/base/273956 Log: filedesc: lock filedesc lock in fdcloseexec only when needed Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Sun Nov 2 00:11:25 2014 (r273955) +++ head/sys/kern/kern_descrip.c Sun Nov 2 01:13:11 2014 (r273956) @@ -2160,19 +2160,17 @@ fdcloseexec(struct thread *td) fdp = td->td_proc->p_fd; KASSERT(fdp->fd_refcnt == 1, ("the fdtable should not be shared")); - FILEDESC_XLOCK(fdp); for (i = 0; i <= fdp->fd_lastfile; i++) { fde = &fdp->fd_ofiles[i]; fp = fde->fde_file; if (fp != NULL && (fp->f_type == DTYPE_MQUEUE || (fde->fde_flags & UF_EXCLOSE))) { + FILEDESC_XLOCK(fdp); fdfree(fdp, i); (void) closefp(fdp, i, fp, td, 0); /* closefp() drops the FILEDESC lock. */ - FILEDESC_XLOCK(fdp); } } - FILEDESC_XUNLOCK(fdp); } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201411020113.sA21DCt9067713>