Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 3 Jan 2014 16:34:16 +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: r260232 - head/sys/kern
Message-ID:  <201401031634.s03GYGu1040703@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mjg
Date: Fri Jan  3 16:34:16 2014
New Revision: 260232
URL: http://svnweb.freebsd.org/changeset/base/260232

Log:
  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.
  
  MFC after:	3 days

Modified:
  head/sys/kern/kern_descrip.c

Modified: head/sys/kern/kern_descrip.c
==============================================================================
--- head/sys/kern/kern_descrip.c	Fri Jan  3 15:55:20 2014	(r260231)
+++ head/sys/kern/kern_descrip.c	Fri Jan  3 16:34:16 2014	(r260232)
@@ -1481,18 +1481,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?201401031634.s03GYGu1040703>