From 0918d4b21fbf6197295f2b50da4acd44557cf9d6 Mon Sep 17 00:00:00 2001 From: Mateusz Guzik Date: Fri, 3 Jan 2014 16:34:16 +0000 Subject: [PATCH] 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 --- sys/kern/kern_descrip.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sys/kern/kern_descrip.c b/sys/kern/kern_descrip.c index c0d9008ea299..f65e65bb7cb2 100644 --- a/sys/kern/kern_descrip.c +++ b/sys/kern/kern_descrip.c @@ -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); }