Date: Mon, 2 May 2011 13:58:41 +0000 (UTC) From: Jaakko Heinonen <jh@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r221323 - stable/8/sys/fs/devfs Message-ID: <201105021358.p42DwfHv040911@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105021358.p42DwfHv040911>