Page MenuHomeFreeBSD

tcp: Shouldn't drain empty sbuf
ClosedPublic

Authored by rscheff on Mar 31 2021, 11:01 PM.
Tags
None
Referenced Files
F82166041: D29524.diff
Fri, Apr 26, 3:10 AM
F82138108: D29524.id86691.diff
Thu, Apr 25, 8:55 PM
F82106934: D29524.id86649.diff
Thu, Apr 25, 2:56 PM
Unknown Object (File)
Thu, Apr 25, 12:24 AM
Unknown Object (File)
Thu, Apr 18, 2:37 PM
Unknown Object (File)
Thu, Apr 18, 8:50 AM
Unknown Object (File)
Sun, Apr 7, 4:34 AM
Unknown Object (File)
Sat, Apr 6, 12:45 PM
Subscribers

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 38230
Build 35119: arc lint + arc unit

Event Timeline

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

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
698

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.