Page MenuHomeFreeBSD

tcp: Shouldn't drain empty sbuf
ClosedPublic

Authored by rscheff on Mar 31 2021, 11:01 PM.
Tags
None
Referenced Files
F147772294: D29524.diff
Fri, Mar 13, 1:25 PM
Unknown Object (File)
Thu, Mar 12, 7:13 AM
Unknown Object (File)
Tue, Mar 10, 12:20 AM
Unknown Object (File)
Mon, Mar 9, 2:56 PM
Unknown Object (File)
Sun, Mar 8, 4:07 AM
Unknown Object (File)
Tue, Mar 3, 10:21 AM
Unknown Object (File)
Mon, Mar 2, 7:58 AM
Unknown Object (File)
Mon, Mar 2, 6:35 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

  • fix typo in assert string
sys/netinet/tcp_hostcache.c
709

Maybe add a comment why you are doing this dance. It wasn't obvious for us...

  • add comment to explain why do_drain is needed
sys/netinet/tcp_hostcache.c
711

Not sure coordination is involved. Isn't it more that one should not call sbuf_drain() with an empty buffer. Please state that and finish the sentence with a full stop (.).

This revision is now accepted and ready to land.Apr 1 2021, 2:40 PM
This revision was automatically updated to reflect the committed changes.

I would probably instead have changed sbuf_drain() to just return instead of asserting. Asserting made sense when it was a private implementation function, as a public API I think just returning instead of asserting is better behavior.