From owner-svn-src-all@FreeBSD.ORG Thu Jun 14 15:35:14 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (unknown [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECD5D106567A; Thu, 14 Jun 2012 15:35:14 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [69.147.83.44]) by mx1.freebsd.org (Postfix) with ESMTP id D90C28FC22; Thu, 14 Jun 2012 15:35:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q5EFZE1w003022; Thu, 14 Jun 2012 15:35:14 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q5EFZEbw003020; Thu, 14 Jun 2012 15:35:14 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201206141535.q5EFZEbw003020@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Thu, 14 Jun 2012 15:35:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r237076 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 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: Thu, 14 Jun 2012 15:35:15 -0000 Author: pjd Date: Thu Jun 14 15:35:14 2012 New Revision: 237076 URL: http://svn.freebsd.org/changeset/base/237076 Log: - Assert that the filedesc lock is being held when fdisused() is called. - Fix white spaces. MFC after: 1 month Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c ============================================================================== --- head/sys/kern/kern_descrip.c Thu Jun 14 15:34:10 2012 (r237075) +++ head/sys/kern/kern_descrip.c Thu Jun 14 15:35:14 2012 (r237076) @@ -243,8 +243,10 @@ static int fdisused(struct filedesc *fdp, int fd) { - KASSERT(fd >= 0 && fd < fdp->fd_nfiles, - ("file descriptor %d out of range (0, %d)", fd, fdp->fd_nfiles)); + FILEDESC_LOCK_ASSERT(fdp); + + KASSERT(fd >= 0 && fd < fdp->fd_nfiles, + ("file descriptor %d out of range (0, %d)", fd, fdp->fd_nfiles)); return ((fdp->fd_map[NDSLOT(fd)] & NDBIT(fd)) != 0); }