svn commit: r260400 - stable/10/sys/kern

Mateusz Guzik mjg at FreeBSD.org
Tue Jan 7 19:28:11 UTC 2014


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);
 }
 


More information about the svn-src-stable mailing list