[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f2b838e4-1911-48c1-9a7e-fe476f763def@redhat.com>
Date: Tue, 10 Dec 2024 12:42:04 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: Kuniyuki Iwashima <kuniyu@...zon.com>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>
Cc: Kuniyuki Iwashima <kuni1840@...il.com>, netdev@...r.kernel.org
Subject: Re: [PATCH v1 net-next 14/15] af_unix: Remove sk_locked logic in
unix_dgram_sendmsg().
On 12/6/24 06:26, Kuniyuki Iwashima wrote:
> @@ -2136,27 +2133,21 @@ static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
> goto restart;
> }
>
> - if (!sk_locked) {
> - unix_state_unlock(other);
> - unix_state_double_lock(sk, other);
> - }
> + unix_state_unlock(other);
> + unix_state_double_lock(sk, other);
>
> if (unix_peer(sk) != other ||
> - unix_dgram_peer_wake_me(sk, other)) {
> + unix_dgram_peer_wake_me(sk, other))
> err = -EAGAIN;
> - sk_locked = 1;
> +
> + unix_state_unlock(sk);
> +
> + if (err)
> goto out_unlock;
> - }
>
> - if (!sk_locked) {
> - sk_locked = 1;
> - goto restart_locked;
> - }
> + goto restart_locked;
I'm likely lost, but AFAICS the old code ensured that 'restart_locked'
was attempted at most once, while now there is no such constraint. Can
this loop forever under some not trivial condition?!?
Thanks!
Paolo
Powered by blists - more mailing lists