From: Alex Hornung Date: Sun, 21 Nov 2010 08:44:02 +0000 (+0000) Subject: devfs - don't propagate on terminate, it's redundant X-Git-Tag: v2.11.0~574 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/e4ff5ef9fab8c016b75c7d782413da414e42c77e devfs - don't propagate on terminate, it's redundant * Don't propagate the device removal in the cdev terminate op since it must have happened before; otherwise something went horribly wrong. * Verify that the cdev isn't linked into the dev list anymore upon terminate. As explained in the commit, this *must* be the case. --- diff --git a/sys/vfs/devfs/devfs_core.c b/sys/vfs/devfs/devfs_core.c index d89ec9ac97..052b86bb90 100644 --- a/sys/vfs/devfs/devfs_core.c +++ b/sys/vfs/devfs/devfs_core.c @@ -2259,8 +2259,15 @@ devfs_cdev_terminate(cdev_t dev) locked = 1; } - /* Propagate destruction, just in case */ - devfs_propagate_dev(dev, 0); + /* + * Make sure the node isn't linked anymore. Otherwise we've screwed + * up somewhere, since normal devs are unlinked on the call to + * destroy_dev and only-cdevs that have not been used for cloning + * are not linked in the first place. only-cdevs used for cloning + * will be linked in, too, and should only be destroyed via + * destroy_dev, not destroy_only_dev, so we catch that problem, too. + */ + KKASSERT((dev->si_flags & SI_DEVFS_LINKED) == 0); /* If we acquired the lock, we also get rid of it */ if (locked)