diff options
author | phk <phk@FreeBSD.org> | 2005-09-15 06:57:28 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 2005-09-15 06:57:28 +0000 |
commit | a543c5b761d580a67a1027a2e3a0578864c4db1b (patch) | |
tree | a380e3da48b6acc169446694555c3a12c2fad544 /sys/fs/devfs/devfs_devs.c | |
parent | 0ae53ca3daa07d34374bb3294304112a9788473c (diff) | |
download | FreeBSD-src-a543c5b761d580a67a1027a2e3a0578864c4db1b.zip FreeBSD-src-a543c5b761d580a67a1027a2e3a0578864c4db1b.tar.gz |
Close a race which could result in unwarranted "ruleset %d already
running" panics.
Previously, recursion through the "include" feature was prevented by
marking each ruleset as "running" when applied. This doesn't work for
the case where two DEVFS instances try to apply the same ruleset at
the same time.
Instead introduce the sysctl vfs.devfs.rule_depth (default == 1) which
limits how many levels of "include" we will traverse.
Be aware that traversal of "include" is recursive and kernel stack
size is limited.
MFC: after 3 days
Diffstat (limited to 'sys/fs/devfs/devfs_devs.c')
-rw-r--r-- | sys/fs/devfs/devfs_devs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/fs/devfs/devfs_devs.c b/sys/fs/devfs/devfs_devs.c index 2329b84..9cec56d 100644 --- a/sys/fs/devfs/devfs_devs.c +++ b/sys/fs/devfs/devfs_devs.c @@ -71,6 +71,10 @@ SYSCTL_UINT(_vfs_devfs, OID_AUTO, inodes, CTLFLAG_RD, SYSCTL_UINT(_vfs_devfs, OID_AUTO, topinode, CTLFLAG_RD, &devfs_topino, 0, "DEVFS highest inode#"); +unsigned devfs_rule_depth = 1; +SYSCTL_UINT(_vfs_devfs, OID_AUTO, rule_depth, CTLFLAG_RW, + &devfs_rule_depth, 0, "Max depth of ruleset include"); + /* * Helper sysctl for devname(3). We're given a struct cdev * and return * the name, if any, registered by the device driver. |