[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLPo61i8-ycKYVrUtEUVMGg09mw153eB3sPX24jXaD9WA@mail.gmail.com>
Date: Thu, 29 Feb 2024 16:50:45 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: "David S . Miller" <davem@...emloft.net>, Paolo Abeni <pabeni@...hat.com>, Jiri Pirko <jiri@...dia.com>,
David Ahern <dsahern@...nel.org>, netdev@...r.kernel.org,
Florian Westphal <fw@...len.de>, eric.dumazet@...il.com
Subject: Re: [PATCH net-next 6/6] inet: use xa_array iterator to implement inet_dump_ifaddr()
On Thu, Feb 29, 2024 at 4:45 PM Eric Dumazet <edumazet@...gle.com> wrote:
>
> On Thu, Feb 29, 2024 at 4:37 PM Jakub Kicinski <kuba@...nel.org> wrote:
> >
> > On Thu, 29 Feb 2024 11:40:16 +0000 Eric Dumazet wrote:
> > > + if (err < 0 && likely(skb->len))
> > > + err = skb->len;
> >
> > I think Ido may have commented on one of your early series, but if we
> > set err to skb->len we'll have to do an extra empty message to terminate
> > the dump.
> >
> > You basically only want to return skb->len when message has
> > overflown, so the somewhat idiomatic way to do this is:
> >
> > err = (err == -EMSGSIZE) ? skb->len : err;
This would set err to zero if skb is empty at this point.
I guess a more correct action would be:
if (err == -EMSGSIZE && likely(skb->len))
err = skb->len;
> >
> > Assuming err can't be set to some weird positive value.
> >
> > IDK if you want to do this in future patches or it's risky, but I have
> > the itch to tell you every time I see a conversion which doesn't follow
> > this pattern :)
>
> This totally makes sense.
>
> I will send a followup patch to fix all these in one go, if this is ok
> with you ?
>
> Thanks.
Powered by blists - more mailing lists