tech-kern archive

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

Re: what is this KASSERT() testing?



On Mon Dec 06 2010 at 11:55:05 +1100, matthew green wrote:
> 
> hi.
> 
> 
> my devbox just crashed with this:
> 
> panic: kernel diagnostic assertion "pg == NULL || pg == PGO_DONTCARE" failed: 
> file "/usr/src/sys/miscfs/genfs/genfs_io.c", line 243
> 
> but i don't understand the KASSERT().  it seems that this sequence
> of events will always trigger:
> 
>                 nfound = uvn_findpages(uobj, origoffset, &npages,
>                     ap->a_m, UFP_NOWAIT|UFP_NOALLOC|(memwrite ? UFP_NORDONLY 
> : 0));
> ...
>                 if (!genfs_node_rdtrylock(vp)) {
> ...
>                         for (i = 0; i < npages; i++) {
>                                 pg = ap->a_m[i];
>                                 if (pg != NULL && pg != PGO_DONTCARE) {
>                                         ap->a_m[i] = NULL;
>                                 }
> 
>                                 KASSERT(pg == NULL || pg == PGO_DONTCARE);
> 
> won't all pages filled in by the uvn_findpages() be not NULL, so
> if the uvn_findpages() succeeds but the genfs_node_rdtrylock() 
> fails, we will trigger this assert always.
> 
> 
> i think it should just be removed.

I guess it wants to test ap->a_m[i], cf. the change to the assignment
clause in the same revision.

-- 
älä karot toivorikkauttas, kyl rätei ja lumpui piisaa


Home | Main Index | Thread Index | Old Index