From owner-svn-src-all@FreeBSD.ORG Fri Jan 3 16:34:17 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 2098AC3F; Fri, 3 Jan 2014 16:34:17 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 0CE951CC1; Fri, 3 Jan 2014 16:34:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id s03GYG2e040704; Fri, 3 Jan 2014 16:34:16 GMT (envelope-from mjg@svn.freebsd.org) Received: (from mjg@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id s03GYGu1040703; Fri, 3 Jan 2014 16:34:16 GMT (envelope-from mjg@svn.freebsd.org) Message-Id: <201401031634.s03GYGu1040703@svn.freebsd.org> From: Mateusz Guzik Date: Fri, 3 Jan 2014 16:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r260232 - head/sys/kern X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 03 Jan 2014 16:34:17 -0000 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); }