Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 May 2011 00:09:57 +0000 (UTC)
From:      Konstantin Belousov <kib@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: r222296 - stable/7/sys/kern
Message-ID:  <201105260009.p4Q09vrf036019@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Thu May 26 00:09:56 2011
New Revision: 222296
URL: http://svn.freebsd.org/changeset/base/222296

Log:
  MFC r222086:
  The protection against the race with dev_rel(), introduced in r163328,
  should be extended to cover destroy_devl() calls for the children of the
  destroyed dev.
  
  Requested and tested by:	Oliver Pinter <oliver.pntr gmail com>

Modified:
  stable/7/sys/kern/kern_conf.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/kern/kern_conf.c
==============================================================================
--- stable/7/sys/kern/kern_conf.c	Wed May 25 23:33:49 2011	(r222295)
+++ stable/7/sys/kern/kern_conf.c	Thu May 26 00:09:56 2011	(r222296)
@@ -874,6 +874,8 @@ destroy_devl(struct cdev *dev)
 	/* Remove name marking */
 	dev->si_flags &= ~SI_NAMED;
 
+	dev->si_refcount++;	/* Avoid race with dev_rel() */
+
 	/* If we are a child, remove us from the parents list */
 	if (dev->si_flags & SI_CHILD) {
 		LIST_REMOVE(dev, si_siblings);
@@ -890,7 +892,6 @@ destroy_devl(struct cdev *dev)
 		dev->si_flags &= ~SI_CLONELIST;
 	}
 
-	dev->si_refcount++;	/* Avoid race with dev_rel() */
 	csw = dev->si_devsw;
 	dev->si_devsw = NULL;	/* already NULL for SI_ALIAS */
 	while (csw != NULL && csw->d_purge != NULL && dev->si_threadcount) {



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