DragonFly bugs List (threaded) for 2006-09
Re: Fix nagging make_dev() warnings
:RCS file: /cvs/src/sys/kern/kern_conf.c,v
:retrieving revision 1.15
:diff -u -r1.15 kern_conf.c
:--- kern_conf.c 10 Sep 2006 01:26:39 -0000 1.15
:+++ kern_conf.c 26 Sep 2006 17:57:16 -0000
:@@ -114,7 +114,7 @@
:-hashdev(struct dev_ops *ops, int x, int y)
:+hashdev(struct dev_ops *ops, int x, int y, int allow_override)
While explaining some make_dev related stuff to Victor I realized that
I made a mistake in my commit.... I had forgotten why I had the ops check
in there in the first place.
The reason is that the kernel can create shadow devices which
are supposed to be invisible to userland. This is why the ops pointer
is compared in hashdev().
So we cannot just allow any ops vector mismatch to be overridden.
I have made a followup commit which adds a flag that hashdev() can
check for and I added a comment to the code describing the reason.