]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Make sbuf_drain safe for external use
authorRichard Scheffenegger <rscheff@FreeBSD.org>
Fri, 2 Apr 2021 18:11:45 +0000 (20:11 +0200)
committerRichard Scheffenegger <rscheff@FreeBSD.org>
Fri, 16 Apr 2021 19:34:26 +0000 (21:34 +0200)
commit424f6363927a113fe5a1dcb4691039ec25cf3680
treea5fe71a56f2a139928aa6157e226258de3255b57
parentdc5281a7d43917c55905d8b83a5bef69b8013071
Make sbuf_drain safe for external use

While sbuf_drain was an internal function, two
KASSERTS checked the sanity of it being called.
However, an external caller may be ignorant if
there is any data to drain, or if an error has
already accumulated. Be nice and return immediately
with the accumulated error.

MFC after: 2 weeks
Reviewed By: tuexen, #transport
Sponsored by: NetApp, Inc.
Differential Revision: https://reviews.freebsd.org/D29544

(cherry picked from commit cad4fd0365a5e3235e715e072e6ee9dffaa7a3ab)
sys/kern/subr_sbuf.c