From owner-svn-src-all@FreeBSD.ORG Wed Aug 25 15:29:13 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51D311065670; Wed, 25 Aug 2010 15:29:13 +0000 (UTC) (envelope-from jh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 41DB08FC17; Wed, 25 Aug 2010 15:29:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o7PFTDwI015514; Wed, 25 Aug 2010 15:29:13 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o7PFTDuK015512; Wed, 25 Aug 2010 15:29:13 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201008251529.o7PFTDuK015512@svn.freebsd.org> From: Jaakko Heinonen Date: Wed, 25 Aug 2010 15:29:13 +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: r211816 - head/sys/fs/devfs 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: Wed, 25 Aug 2010 15:29:13 -0000 Author: jh Date: Wed Aug 25 15:29:12 2010 New Revision: 211816 URL: http://svn.freebsd.org/changeset/base/211816 Log: Call devfs_populate_vp() from devfs_getattr(). It was possible that fstat(2) returned stale information through an open file descriptor. Modified: head/sys/fs/devfs/devfs_vnops.c Modified: head/sys/fs/devfs/devfs_vnops.c ============================================================================== --- head/sys/fs/devfs/devfs_vnops.c Wed Aug 25 15:21:26 2010 (r211815) +++ head/sys/fs/devfs/devfs_vnops.c Wed Aug 25 15:29:12 2010 (r211816) @@ -618,10 +618,18 @@ devfs_getattr(struct vop_getattr_args *a { struct vnode *vp = ap->a_vp; struct vattr *vap = ap->a_vap; - int error = 0; + int error; struct devfs_dirent *de; + struct devfs_mount *dmp; struct cdev *dev; + error = devfs_populate_vp(vp); + if (error != 0) + return (error); + + dmp = VFSTODEVFS(vp->v_mount); + sx_xunlock(&dmp->dm_lock); + de = vp->v_data; KASSERT(de != NULL, ("Null dirent in devfs_getattr vp=%p", vp)); if (vp->v_type == VDIR) {