summaryrefslogtreecommitdiffstats
path: root/sys/kern/kern_conf.c
diff options
context:
space:
mode:
authorkib <kib@FreeBSD.org>2007-07-04 06:56:58 +0000
committerkib <kib@FreeBSD.org>2007-07-04 06:56:58 +0000
commitbbfd17f7e8ab03daa669455f00b7384b82b2691a (patch)
tree27b69adf2610deadddf2c9ace920c1d76d1bedac /sys/kern/kern_conf.c
parent4a90acd0851dafc13365ee00d3da1b04b9e4c5f2 (diff)
downloadFreeBSD-src-bbfd17f7e8ab03daa669455f00b7384b82b2691a.zip
FreeBSD-src-bbfd17f7e8ab03daa669455f00b7384b82b2691a.tar.gz
Since cdev mutex is after system map mutex in global lock order, free()
shall not be called while holding cdev mutex. devfs_inos unrhdr has cdev as mutex, thus creating this LOR situation. Postpone calling free() in kern/subr_unit.c:alloc_unr() and nested functions until the unrhdr mutex is dropped. Save the freed items on the ppfree list instead, and provide the clean_unrhdrl() and clean_unrhdr() functions to clean the list. Call clean_unrhdrl() after devfs_create() calls immediately before dropping cdev mutex. devfs_create() is the only user of the alloc_unrl() in the tree. Reviewed by: phk Tested by: Peter Holm LOR: 80 Approved by: re (kensmith)
Diffstat (limited to 'sys/kern/kern_conf.c')
-rw-r--r--sys/kern/kern_conf.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/kern/kern_conf.c b/sys/kern/kern_conf.c
index 20d3bc3..751f524 100644
--- a/sys/kern/kern_conf.c
+++ b/sys/kern/kern_conf.c
@@ -617,6 +617,7 @@ make_dev_credv(int flags, struct cdevsw *devsw, int minornr,
dev->si_mode = mode;
devfs_create(dev);
+ clean_unrhdrl(devfs_inos);
dev_unlock();
return (dev);
}
@@ -703,6 +704,7 @@ make_dev_alias(struct cdev *pdev, const char *fmt, ...)
va_end(ap);
devfs_create(dev);
+ clean_unrhdrl(devfs_inos);
dev_unlock();
dev_depends(pdev, dev);
return (dev);
OpenPOWER on IntegriCloud