From: Abhinav Singh <singhabhinav9051571833@gmail.com>
To: Eric Dumazet <edumazet@google.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
davem@davemloft.net, dsahern@kernel.org, kuba@kernel.org,
pabeni@redhat.com, netdev@vger.kernel.org,
linux-kernel-mentees@lists.linuxfoundation.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Remove extra unlock for the mutex
Date: Thu, 12 Oct 2023 00:37:37 +0530 [thread overview]
Message-ID: <b34b4e95-2d0c-4cb0-97b0-2613857d2c35@gmail.com> (raw)
In-Reply-To: <CANn89i+hMbhLqXKCF2P=HVeeRSCxvgH_xY1b=T=udLFJjG3ZwA@mail.gmail.com>
On 10/11/23 23:13, Eric Dumazet wrote:
>
> There is no undefined behavior, only sparse that might be confused a little.
>
> I do not think we can express in sparse the fact that
> inet_csk_find_open_port() acquires head->lock
>
> (head being the return value of this function...)
>
> The following does not help.
>
> diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
> index aeebe881668996057d1495c84eee0f0b644b7ad0..ed7b3993316cd1ba0b2859b0bd3f447e066bd3b5
> 100644
> --- a/net/ipv4/inet_connection_sock.c
> +++ b/net/ipv4/inet_connection_sock.c
> @@ -323,6 +323,7 @@ static struct inet_bind_hashbucket *
> inet_csk_find_open_port(const struct sock *sk, struct
> inet_bind_bucket **tb_ret,
> struct inet_bind2_bucket **tb2_ret,
> struct inet_bind_hashbucket **head2_ret, int *port_ret)
> + __acquires(head->lock)
> {
> struct inet_hashinfo *hinfo = tcp_or_dccp_get_hashinfo(sk);
> int i, low, high, attempt_half, port, l3mdev;
Okay got it. Thank you for your time maintainers.And apologizes for not
thoroughly checking before sending the patch. I have a question, there
were some type checking warning as well from sparse tool. Can a create
patch for fixing those type checking warning?
next prev parent reply other threads:[~2023-10-11 19:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-10 22:46 [PATCH] Remove extra unlock for the mutex Abhinav Singh
2023-10-10 22:51 ` Florian Fainelli
2023-10-11 0:28 ` Kuniyuki Iwashima
2023-10-11 15:47 ` Florian Fainelli
2023-10-11 6:30 ` Greg KH
2023-10-11 15:49 ` Abhinav Singh
2023-10-11 17:43 ` Eric Dumazet
2023-10-11 19:07 ` Abhinav Singh [this message]
2023-10-16 14:08 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b34b4e95-2d0c-4cb0-97b0-2613857d2c35@gmail.com \
--to=singhabhinav9051571833@gmail.com \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=kuba@kernel.org \
--cc=linux-kernel-mentees@lists.linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox