From owner-cvs-all@FreeBSD.ORG Wed May 28 20:25:19 2008 Return-Path: Delivered-To: cvs-all@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ABF0A106566B; Wed, 28 May 2008 20:25:19 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id A04D28FC16; Wed, 28 May 2008 20:25:19 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id m4SKPJdD097902; Wed, 28 May 2008 20:25:19 GMT (envelope-from ed@repoman.freebsd.org) Received: (from ed@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id m4SKPJgY097901; Wed, 28 May 2008 20:25:19 GMT (envelope-from ed) Message-Id: <200805282025.m4SKPJgY097901@repoman.freebsd.org> From: Ed Schouten Date: Wed, 28 May 2008 20:25:19 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/kern kern_descrip.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 May 2008 20:25:19 -0000 ed 2008-05-28 20:25:19 UTC FreeBSD src repository Modified files: sys/kern kern_descrip.c Log: Remove redundant checks from fcntl()'s F_DUPFD. Right now we perform some of the checks inside the fcntl()'s F_DUPFD operation twice. We first validate the `fd' argument. When finished, we validate the `arg' argument. These checks are also performed inside do_dup(). The reason we need to do this, is because fcntl() should return different errno's when the `arg' argument is out of bounds (EINVAL instead of EBADF). To prevent the redundant locking of the PROC_LOCK and FILEDESC_SLOCK, patch do_dup() to support the error semantics required by fcntl(). Approved by: philip (mentor) Revision Changes Path 1.334 +16 -31 src/sys/kern/kern_descrip.c