Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Jan 2002 22:37:35 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Michael Reifenberger <root@nihil.plaut.de>
Cc:        FreeBSD-Current <current@FreeBSD.ORG>
Subject:   Re: panic during fdisk'ing a md(4) device
Message-ID:  <20020113222214.X598-100000@gamplex.bde.org>
In-Reply-To: <20020112130202.F451-100000@nihil>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 12 Jan 2002, Michael Reifenberger wrote:

> Hi,
> more input:
> The panic occurs in dsname() while dereferencing devsw(dev)->d_name.
> devsw(dev) gives NULL.

This was fairly clear from the panic message (the low fault address
is almost certainly for a null pointer + offset, and it's fairly clear
how dsname() gets a null pointer).  Sorry I didn't reply earlier and
save you the work debugging this.

> The call to dsname() occurs from dkmodminor() defined in disklabel.h
> I've seen two calls to dsname, only the second one panics.
> Any thoughts?

dkmodminor() is supposed to modify a minor device that already has a
devswitch.  Since dsname() in it panics, the problem is earlier when
the minor device is created without giving it a devswitch.  Minor
devices are supposed to be created in a hierarchial order so that
this doesn't happen.  E.g.,

    ad0                  in disk_create() (only ?)
        ad0s1            now in dsopen()
        ad0s2
            ad0s2a       now in dsopen()
            ...

I suggest adding printfs to make_dev() and makedev() to track the order.
The problem occurs when makedev() is called without a corresponding
make_dev().

Bruce


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-current" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020113222214.X598-100000>