Subject: Re: raidctl panic
To: Manuel Bouyer <>
From: Greg Oster <>
List: tech-kern
Date: 12/06/2007 13:36:16
Manuel Bouyer writes:
> Hi,
> running raidctl -c on current with debug options I get:
> panic: kernel diagnostic assertion "(l) == curlwp" failed: file "/dsk/l1/misc
> /bouyer/current/src/sys/dev/dksubr.c", line 640
> Stopped in pid 8.1 (raidctl) at netbsd:breakpoint+0x1:  ret
> breakpoint() at netbsd:breakpoint+0x1
> __kernassert() at netbsd:__kernassert+0x2d
> dk_lookup() at netbsd:dk_lookup+0x198
> rf_ConfigureDisk() at netbsd:rf_ConfigureDisk+0x10a
> rf_ConfigureDisks() at netbsd:rf_ConfigureDisks+0xb9
> rf_Configure() at netbsd:rf_Configure+0x6fc
> raidioctl() at netbsd:raidioctl+0xf05
> VOP_IOCTL() at netbsd:VOP_IOCTL+0x2e
> vn_ioctl() at netbsd:vn_ioctl+0x79
> sys_ioctl() at netbsd:sys_ioctl+0x1bc
> syscall() at netbsd:syscall+0xe5
> Reading the code I understand why we get a panic (rf_ConfigureDisk pass
> raidPtr->engine_thread to dk_lookup()), the question is what would be
> the fix ...

I'd like to know too....  IIRC, the code was changed (some years ago)
to what it is now because curproc->lwp0->cred (or some such) being passed
in wasn't sufficient to match the credentials of the kernel thread.  
If it is now the case that l->l_cred == curlwp->l_cred == 
some_other_kernel_lwp->l_cred , then we probably don't need to be 
passing 'engine_thread' into dk_lookup() anymore, and just curlwp 
will be sufficient... 


Greg Oster