OSDN Git Service

unix: Improve locking scheme in unix_show_fdinfo()
authorKirill Tkhai <tkhai@ya.ru>
Sat, 14 Jan 2023 09:35:02 +0000 (12:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Jan 2023 11:21:11 +0000 (11:21 +0000)
commitb27401a30ee466c4476b035487be0580767ba1fb
treed2e97d34aecaddbddb5fe2cc4c5f7449c09a07db
parent40ea3ee2ced1a6eb3d6b22ecda40f5f6179fd990
unix: Improve locking scheme in unix_show_fdinfo()

After switching to TCP_ESTABLISHED or TCP_LISTEN sk_state, alive SOCK_STREAM
and SOCK_SEQPACKET sockets can't change it anymore (since commit 3ff8bff704f4
"unix: Fix race in SOCK_SEQPACKET's unix_dgram_sendmsg()").

Thus, we do not need to take lock here.

Signed-off-by: Kirill Tkhai <tkhai@ya.ru>
Reviewed-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/unix/af_unix.c