tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

KASSERT(cf->cf_state == FSTATE_NOTFOUND)



Hi,

Its been a while since I tried DIAGNOSTIC but I just tried a new kernel
and immediately got a panic in config_attach_pseudo() at the recently
added:

        if (cf->cf_fstate != FSTATE_STAR) {
                KASSERT(cf->cf_fstate == FSTATE_NOTFOUND);
                cf->cf_fstate = FSTATE_FOUND;
        }

It was triggered by "ifconfig tap0 create", as in tap_clone_creator() we
have the following:

        if (unit == -1) {
                /* let autoconf find the first free one */
                cf->cf_unit = 0;
                cf->cf_fstate = FSTATE_STAR;
        } else {
                cf->cf_unit = unit;
                cf->cf_fstate = FSTATE_FOUND;
        }

        return device_private(config_attach_pseudo(cf));
}

I'm not rightly clear which party is on the wrong foot but the only other
place I can find a construct where a specific instance gets attached is in
md.c and it uses FSTATE_NOTFOUND so perhaps the assertion is correct and
the following patch should be applied?

iain

Index: if_tap.c
===================================================================
RCS file: /cvsroot/src/sys/net/if_tap.c,v
retrieving revision 1.57
diff -u -r1.57 if_tap.c
--- if_tap.c    11 Apr 2009 23:05:26 -0000      1.57
+++ if_tap.c    12 Jul 2009 20:38:37 -0000
@@ -658,7 +658,7 @@
                cf->cf_fstate = FSTATE_STAR;
        } else {
                cf->cf_unit = unit;
-               cf->cf_fstate = FSTATE_FOUND;
+               cf->cf_fstate = FSTATE_NOTFOUND;
        }

        return device_private(config_attach_pseudo(cf));


Home | Main Index | Thread Index | Old Index