Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 7 Jan 2014 19:28:11 +0000 (UTC)
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r260400 - stable/10/sys/kern
Message-ID:  <201401071928.s07JSB2s056102@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Tue Jan  7 19:28:10 2014
New Revision: 260400
URL: http://svnweb.freebsd.org/changeset/base/260400

Log:
  MFC r260232:
  Don't check for fd limits in fdgrowtable_exp.
  
  Callers do that already and additional check races with process
  decreasing limits and can result in not growing the table at all, which
  is currently not handled.

Modified:
  stable/10/sys/kern/kern_descrip.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/sys/kern/kern_descrip.c
==============================================================================
--- stable/10/sys/kern/kern_descrip.c	Tue Jan  7 19:02:08 2014	(r260399)
+++ stable/10/sys/kern/kern_descrip.c	Tue Jan  7 19:28:10 2014	(r260400)
@@ -1482,18 +1482,13 @@ filecaps_validate(const struct filecaps 
 static void
 fdgrowtable_exp(struct filedesc *fdp, int nfd)
 {
-	int nfd1, maxfd;
+	int nfd1;
 
 	FILEDESC_XLOCK_ASSERT(fdp);
 
 	nfd1 = fdp->fd_nfiles * 2;
 	if (nfd1 < nfd)
 		nfd1 = nfd;
-	maxfd = getmaxfd(curproc);
-	if (maxfd < nfd1)
-		nfd1 = maxfd;
-	KASSERT(nfd <= nfd1,
-	    ("too low nfd1 %d %d %d %d", nfd, fdp->fd_nfiles, maxfd, nfd1));
 	fdgrowtable(fdp, nfd1);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201401071928.s07JSB2s056102>