lkml.org 
[lkml]   [2023]   [Jan]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [External] Re: [PATCH v2] sock: add tracepoint for send recv length
On Fri, Jan 6, 2023 at 12:07 PM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Fri, 6 Jan 2023 11:24:18 +0800
> 运辉崔 <cuiyunhui@bytedance.com> wrote:
>
> > Regardless of whether the MSG_PEEK flag is set or not, it is possible
> > to return -errno,
> > but based on your suggestion, I plan to modify it like this:
> >
> > trace_sock_recvmsg_length(sock->sk, sock->sk->sk_family,
> > sock->sk->sk_protocol,
> > !(flags & MSG_PEEK) ? ret : (ret < 0 ? ret : 0),
> >
> > what do you think?
>
> Sure.

Ok, Thank you.

>
> But note, from your original patch:
>
> > + trace_sock_recvmsg_length(sock->sk, sock->sk->sk_family,
> > + sock->sk->sk_protocol,
> > + (ret > 0 && !(flags & MSG_PEEK)) ?
> > + ret : 0,
> > + (ret > 0 && !(flags & MSG_PEEK)) ? 0 : ret,
> > + flags);
>
> If flags MSG_PEEK is set, you return ret in error regardless, so error
> would be ret even if it was positive.
>
> So I'm guessing that this change actually fixed a bug. ;-)
>
> -- Steve

Ha-ha, seems like it,I will modify these and post v3.

Thanks,
Yunhui

\
 
 \ /
  Last update: 2023-03-26 23:29    [W:0.046 / U:0.360 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site