Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Mar 2011 16:51:28 +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: r219453 - stable/7/sys/fs/devfs
Message-ID:  <201103101651.p2AGpSmC049770@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jh
Date: Thu Mar 10 16:51:28 2011
New Revision: 219453
URL: http://svn.freebsd.org/changeset/base/219453

Log:
  MFC r179926 by gonzo:
  
  Get pointer to devfs_ruleset struct after garbage collection has been
  performed. Otherwise if ruleset is used by given mountpoint and is empty
  it's freed by devfs_ruleset_reap and pointer becomes bogus.
  
  PR:		kern/124853

Modified:
  stable/7/sys/fs/devfs/devfs_rule.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_rule.c
==============================================================================
--- stable/7/sys/fs/devfs/devfs_rule.c	Thu Mar 10 16:40:13 2011	(r219452)
+++ stable/7/sys/fs/devfs/devfs_rule.c	Thu Mar 10 16:51:28 2011	(r219453)
@@ -735,15 +735,15 @@ devfs_ruleset_use(devfs_rsnum rsnum, str
 {
 	struct devfs_ruleset *cds, *ds;
 
-	ds = devfs_ruleset_bynum(rsnum);
-	if (ds == NULL)
-		ds = devfs_ruleset_create(rsnum);
 	if (dm->dm_ruleset != 0) {
 		cds = devfs_ruleset_bynum(dm->dm_ruleset);
 		--cds->ds_refcount;
 		devfs_ruleset_reap(cds);
 	}
 
+	ds = devfs_ruleset_bynum(rsnum);
+	if (ds == NULL)
+		ds = devfs_ruleset_create(rsnum);
 	/* These should probably be made atomic somehow. */
 	++ds->ds_refcount;
 	dm->dm_ruleset = rsnum;



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