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
This commit is contained in:
Mateusz Guzik 2014-01-03 16:34:16 +00:00
parent d473bac729
commit 0918d4b21f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=260232

View File

@ -1481,18 +1481,13 @@ filecaps_validate(const struct filecaps *fcaps, const char *func)
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);
}