From owner-svn-src-all@FreeBSD.ORG Mon May 2 13:58:41 2011 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 706C4106566C; Mon, 2 May 2011 13:58:41 +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 445618FC15; Mon, 2 May 2011 13:58:41 +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 p42DwfWk040915; Mon, 2 May 2011 13:58:41 GMT (envelope-from jh@svn.freebsd.org) Received: (from jh@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id p42DwfHv040911; Mon, 2 May 2011 13:58:41 GMT (envelope-from jh@svn.freebsd.org) Message-Id: <201105021358.p42DwfHv040911@svn.freebsd.org> From: Jaakko Heinonen Date: Mon, 2 May 2011 13:58:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r221323 - stable/8/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: Mon, 02 May 2011 13:58:41 -0000 Author: jh Date: Mon May 2 13:58:40 2011 New Revision: 221323 URL: http://svn.freebsd.org/changeset/base/221323 Log: MFC r216461: - Assert that dm_lock is exclusively held in devfs_rules_apply() and in devfs_vmkdir() while adding the entry to de_list of the parent. - Apply devfs rules to newly created directories and symbolic links. PR: kern/125034 Modified: stable/8/sys/fs/devfs/devfs_devs.c stable/8/sys/fs/devfs/devfs_rule.c stable/8/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/devfs/devfs_devs.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_devs.c Mon May 2 13:56:47 2011 (r221322) +++ stable/8/sys/fs/devfs/devfs_devs.c Mon May 2 13:58:40 2011 (r221323) @@ -248,8 +248,10 @@ devfs_vmkdir(struct devfs_mount *dmp, ch de->de_dir = dd; } else { de->de_dir = dotdot; + sx_assert(&dmp->dm_lock, SX_XLOCKED); TAILQ_INSERT_TAIL(&dotdot->de_dlist, dd, de_list); dotdot->de_links++; + devfs_rules_apply(dmp, dd); } #ifdef MAC Modified: stable/8/sys/fs/devfs/devfs_rule.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_rule.c Mon May 2 13:56:47 2011 (r221322) +++ stable/8/sys/fs/devfs/devfs_rule.c Mon May 2 13:58:40 2011 (r221323) @@ -139,6 +139,8 @@ devfs_rules_apply(struct devfs_mount *dm { struct devfs_ruleset *ds; + sx_assert(&dm->dm_lock, SX_XLOCKED); + if (dm->dm_ruleset == 0) return; sx_slock(&sx_rules); Modified: stable/8/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/8/sys/fs/devfs/devfs_vnops.c Mon May 2 13:56:47 2011 (r221322) +++ stable/8/sys/fs/devfs/devfs_vnops.c Mon May 2 13:58:40 2011 (r221323) @@ -1493,6 +1493,7 @@ devfs_symlink(struct vop_symlink_args *a mac_devfs_create_symlink(ap->a_cnp->cn_cred, dmp->dm_mount, dd, de); #endif TAILQ_INSERT_TAIL(&dd->de_dlist, de, de_list); + devfs_rules_apply(dmp, de); return (devfs_allocv(de, ap->a_dvp->v_mount, LK_EXCLUSIVE, ap->a_vpp)); }