DragonFly bugs List (threaded) for 2006-09
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
Re: Fix nagging make_dev() warnings
Well, I see there is a hidden bug, that's not just a feature. This is not
a fix, but at least it gives a hint where the problem is located. Please
have a look at the patches below. With patch #1 for hashdev() "consolectl"
is correctly retrieved from the device hash table and, consequently, the
warning doesn't show up. Patch #2 indicates why the original hashdev()
failed. It provides some debugging output for spec_open(), and in case
somebody is interested, I have posted a corresponding dmesg output at
http://www.senax.net/downloads/dmesg.debug
For "consolectl" it shows that dev->si_ops->head.name was changed from
"sc" to "intercept", which should not happen. Apparently something is
messed up in sys/kern/tty_cons.c, but I haven't yet checked the details.
Regards,
Frank Josellis
--- patch_1 begins here ---
--- src/sys/kern/kern_conf.c.orig 2006-09-10 03:26:39.000000000 +0200
+++ src/sys/kern/kern_conf.c 2006-09-14 21:16:53.000000000 +0200
@@ -124,8 +124,8 @@
udev = makeudev(x, y);
hash = udev % DEVT_HASH;
LIST_FOREACH(si, &dev_hash[hash], si_hash) {
- if (si->si_ops == ops && si->si_udev == udev)
- return (si);
+ if (si->si_ops->head.maj == ops->head.maj && si->si_udev == udev)
+ return (si);
}
if (stashed >= DEVT_STASH) {
MALLOC(si, struct cdev *, sizeof(*si), M_DEVT,
--- patch_1 ends here ---
--- patch_2 begins here ---
--- src/sys/vfs/specfs/spec_vnops.c.orig 2006-09-10 03:26:41.000000000 +0200
+++ src/sys/vfs/specfs/spec_vnops.c 2006-09-14 21:44:43.000000000 +0200
@@ -266,6 +266,10 @@
dev->si_bsize_phys = DEV_BSIZE;
vinitvmio(vp, IDX_TO_OFF(INT_MAX));
}
+ if ( dev->si_ops->head.maj != 2) {
+ printf("spec_open: \"%s\" (%s, %p)\n",
+ devtoname(dev), dev_dname(dev), dev);
+ }
if ((dev_dflags(dev) & D_DISK) == 0) {
cp = devtoname(dev);
if (*cp == '#') {
--- patch_2 ends here ---
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]