Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 May 2011 15:38:11 +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-7@freebsd.org
Subject:   svn commit: r222311 - stable/7/sys/fs/devfs
Message-ID:  <201105261538.p4QFcBU4070444@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Thu May 26 15:38:11 2011
New Revision: 222311
URL: http://svn.freebsd.org/changeset/base/222311

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/7/sys/fs/devfs/devfs_devs.c
  stable/7/sys/fs/devfs/devfs_rule.c
  stable/7/sys/fs/devfs/devfs_vnops.c
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/fs/devfs/devfs_devs.c
==============================================================================
--- stable/7/sys/fs/devfs/devfs_devs.c	Thu May 26 15:01:37 2011	(r222310)
+++ stable/7/sys/fs/devfs/devfs_devs.c	Thu May 26 15:38:11 2011	(r222311)
@@ -222,8 +222,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/7/sys/fs/devfs/devfs_rule.c
==============================================================================
--- stable/7/sys/fs/devfs/devfs_rule.c	Thu May 26 15:01:37 2011	(r222310)
+++ stable/7/sys/fs/devfs/devfs_rule.c	Thu May 26 15:38:11 2011	(r222311)
@@ -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/7/sys/fs/devfs/devfs_vnops.c
==============================================================================
--- stable/7/sys/fs/devfs/devfs_vnops.c	Thu May 26 15:01:37 2011	(r222310)
+++ stable/7/sys/fs/devfs/devfs_vnops.c	Thu May 26 15:38:11 2011	(r222311)
@@ -1418,6 +1418,7 @@ devfs_symlink(struct vop_symlink_args *a
 	mac_create_devfs_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, ap->a_vpp, td));
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105261538.p4QFcBU4070444>