[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANn89iLnNF0+=dSr9wJFbH+vDene0cnhq4wN0WVBP85Ty3s4AQ@mail.gmail.com>
Date: Tue, 16 Mar 2021 10:59:36 +0100
From: Eric Dumazet <edumazet@...gle.com>
To: Pavel Machek <pavel@...x.de>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
LKML <linux-kernel@...r.kernel.org>, stable@...r.kernel.org,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH 4.19 012/120] tcp: annotate tp->write_seq lockless reads
On Tue, Mar 16, 2021 at 10:50 AM Pavel Machek <pavel@...x.de> wrote:
>
> > --- a/net/ipv4/tcp_minisocks.c
> > +++ b/net/ipv4/tcp_minisocks.c
> > @@ -510,7 +510,7 @@ struct sock *tcp_create_openreq_child(co
> > newtp->app_limited = ~0U;
> >
> > tcp_init_xmit_timers(newsk);
> > - newtp->write_seq = newtp->pushed_seq = treq->snt_isn + 1;
> > + WRITE_ONCE(newtp->write_seq, newtp->pushed_seq = treq->snt_isn + 1);
>
> Would it be better to do assignment to pushed_seq outside of
> WRITE_ONCE macro? This is ... "interesting".
You are probably right, this looks odd and was not something I intended.
It happened to just work, but feel free to send a patch to clean it up.
Thanks.
Powered by blists - more mailing lists