Page MenuHomeFreeBSD

add kasserts to nfsm_trimtrailing as suggested by kib@
ClosedPublic

Authored by rmacklem on Sat, Jan 9, 12:20 AM.

Details

Summary

Add KASSERTS to nfsm_trimtrailing() to confirm the sanity of
the arguments for the M_EXTPG case.

Kostik, is this what you were suggesting?

Test Plan

Set ND_EXTPG flag for all NFS RPCs so the the case
where VOP_CREATE() returns ERELOOKUP hsppens
executing nfsm_trimtrailing() with M_EXTPG mbufs.

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

rmacklem created this revision.

Yes, intent was to re-check that bpos points to the same position as bextpg with bextpgsiz. But I see (PAGE_SIZE - bextpgsiz) and now see that my understanding was wrong.

Please note that PHYS_TO_DMAP() is not available on all platforms, other code does #ifdef PHYS_TO_DMAP around code that only makes sense on machines with DMAP.

Yes, bextpgsiz is the bytes remaining to be used in the page.
It was easier than using offset within the page, since there
is 1st_page_off to deal with.

Actually PHYS_TO_DMAP() is defined for all arches,
but just does a panic() on the ones (like i386)
that don't support it.
--> NFS over TLS is only enabled for arches that

support DMAP and that is the only time the
NFS code generates M_EXTPG pages.

--> Should be ok.

This revision is now accepted and ready to land.Sat, Jan 9, 4:30 AM