On Sat, Aug 21, 1999 at 04:22:46AM +0200, Luigi Rizzo wrote:
> Hi,
>
> > I've found panics are more likely to occur if the command pair is
> > executed in a script vs. from the command line. This may suggest some
> > sort of race is occurring.
>
> no idea... i have always managed to panic the system even running the
> commands from the command line one at a time, so i don't think it is a
> race.
>
> I think i also got the paninc trying a disklabel when the "vn" device
> was not in the kernel, but this one i had no time to reproduce.
The problem is that disklabel executes code in subr_diskslice.c which
does:
dev1 = dkmodslice(dkmodpart(dev, RAW_PART), slice);
The 'dev' structure has s_drv1 set correctly, but the 'dev1' entry
has s_drv1 NULL. When vnstrategy() is called using dev1,
vn = bp->b_dev->s_drv1 is NULL when it shouldn't be. The first time
vn is referenced... fall down go boom.
In my code (a bit similar to what picobsd is doing), I can open /dev/vn0,
ioctl(fd,VNIOCATTACH,...), ioctl(fd,VNIOCUSET,...) and close without
a problem. Execing '/sbin/disklabel -Brw /dev/rvn0 blah' causes
the machine to panic. I've patched vnstrategy() to fail gracefully
if bp->b_dev->s_drv1 is NULL, but I'm still looking for the place
where the dev1 entry is supposed to be initialised.
--
John Birrell - [EMAIL PROTECTED]; [EMAIL PROTECTED] http://www.cimlogic.com.au/
CIMlogic Pty Ltd, GPO Box 117A, Melbourne Vic 3001, Australia +61 418 353 137
To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message