lkml.org 
[lkml]   [2022]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] SO_ZEROCOPY should rather return -ENOPROTOOPT
Hello,

Willem de Bruijn, le mar. 01 mars 2022 10:21:41 -0500, a ecrit:
> > > > > > @@ -1377,9 +1377,9 @@ int sock_setsockopt(struct socket *sock, int level, int optname,
> > > > > > if (!(sk_is_tcp(sk) ||
> > > > > > (sk->sk_type == SOCK_DGRAM &&
> > > > > > sk->sk_protocol == IPPROTO_UDP)))
> > > > > > - ret = -ENOTSUPP;
> > > > > > + ret = -ENOPROTOOPT;
> > > > > > } else if (sk->sk_family != PF_RDS) {
> > > > > > - ret = -ENOTSUPP;
> > > > > > + ret = -ENOPROTOOPT;
> > > > > > }
> > > > > > if (!ret) {
> > > > > > if (val < 0 || val > 1)
> > > > >
> > > > > That should have been a public error code. Perhaps rather EOPNOTSUPP.
> > > > >
> > > > > The problem with a change now is that it will confuse existing
> > > > > applications that check for -524 (ENOTSUPP).
> > > >
> > > > They were not supposed to hardcord -524...
> > > >
> > > > Actually, they already had to check against EOPNOTSUPP to support older
> > > > kernels, so EOPNOTSUPP is not supposed to pose a problem.
> > >
> > > Which older kernels returned EOPNOTSUPP on SO_ZEROCOPY?
> >
> > Sorry, bad copy/paste, I meant ENOPROTOOPT.
>
> Same point though, right? These are not legacy concerns, but specific
> to applications written to SO_ZEROCOPY.
>
> I expect that most will just ignore the exact error code and will work
> with either.

Ok, so, is this an Acked-by: you? :)

Samuel

\
 
 \ /
  Last update: 2022-03-06 20:23    [W:0.071 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site