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
F106103840: D28053.diff
Wed, Dec 25, 11:21 AM
Unknown Object (File)
Wed, Dec 11, 4:30 PM
Unknown Object (File)
Thu, Dec 5, 5:22 AM
Unknown Object (File)
Nov 4 2024, 9:38 AM
Unknown Object (File)
Oct 25 2024, 9:15 PM
Unknown Object (File)
Oct 25 2024, 9:15 PM
Unknown Object (File)
Oct 25 2024, 9:15 PM
Unknown Object (File)
Oct 25 2024, 8:53 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 Skipped
Unit
Tests Skipped

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