[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241206052607.1197-11-kuniyu@amazon.com>
Date: Fri, 6 Dec 2024 14:26:02 +0900
From: Kuniyuki Iwashima <kuniyu@...zon.com>
To: "David S. Miller" <davem@...emloft.net>, Eric Dumazet
<edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo Abeni
<pabeni@...hat.com>
CC: Kuniyuki Iwashima <kuniyu@...zon.com>, Kuniyuki Iwashima
<kuni1840@...il.com>, <netdev@...r.kernel.org>
Subject: [PATCH v1 net-next 10/15] af_unix: Split restart label in unix_dgram_sendmsg().
There are two paths jumping to the restart label in unix_dgram_sendmsg().
One requires another lookup and sk_filter(), but the other doesn't.
Let's split the label to make each flow more straightforward.
Signed-off-by: Kuniyuki Iwashima <kuniyu@...zon.com>
---
net/unix/af_unix.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index fdcd33b4e0ce..b23d36b049da 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -2042,8 +2042,8 @@ static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
timeo = sock_sndtimeo(sk, msg->msg_flags & MSG_DONTWAIT);
-restart:
if (!other) {
+lookup:
other = unix_find_other(sock_net(sk), msg->msg_name,
msg->msg_namelen, sk->sk_type);
if (IS_ERR(other)) {
@@ -2059,6 +2059,7 @@ static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
goto out_free;
}
+restart:
sk_locked = 0;
unix_state_lock(other);
restart_locked:
@@ -2106,7 +2107,8 @@ static int unix_dgram_sendmsg(struct socket *sock, struct msghdr *msg,
other = NULL;
if (err)
goto out_free;
- goto restart;
+
+ goto lookup;
}
if (other->sk_shutdown & RCV_SHUTDOWN) {
--
2.39.5 (Apple Git-154)
Powered by blists - more mailing lists