Page MenuHomeFreeBSD

add kasserts to nfsm_trimtrailing as suggested by kib@
ClosedPublic

Authored by rmacklem on Jan 9 2021, 12:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 20 2023, 4:20 PM
Unknown Object (File)
Dec 20 2023, 3:34 AM
Unknown Object (File)
Sep 14 2023, 12:52 AM
Unknown Object (File)
Aug 28 2023, 4:29 AM
Unknown Object (File)
Aug 28 2023, 4:29 AM
Unknown Object (File)
Aug 28 2023, 4:27 AM
Unknown Object (File)
Aug 28 2023, 4:18 AM
Unknown Object (File)
Jul 15 2023, 10:28 PM
Subscribers
None

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
rG FreeBSD src repository
Lint
Lint Not Applicable
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.Jan 9 2021, 4:30 AM