From: Wenjia Zhang <wenjia@linux.ibm.com>
To: "D. Wythe" <alibuda@linux.alibaba.com>,
kgraul@linux.ibm.com, jaka@linux.ibm.com, wintera@linux.ibm.com
Cc: kuba@kernel.org, davem@davemloft.net, netdev@vger.kernel.org,
linux-s390@vger.kernel.org, linux-rdma@vger.kernel.org
Subject: Re: [PATCH net v1 1/3] net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT
Date: Thu, 2 Nov 2023 11:34:36 +0100 [thread overview]
Message-ID: <72b57457-43e1-49f7-9670-08bbf03231e1@linux.ibm.com> (raw)
In-Reply-To: <1698904324-33238-2-git-send-email-alibuda@linux.alibaba.com>
On 02.11.23 06:52, D. Wythe wrote:
> From: "D. Wythe" <alibuda@linux.alibaba.com>
>
> Considering scenario:
>
> smc_cdc_rx_handler
> __smc_release
> sock_set_flag
> smc_close_active()
> sock_set_flag
>
> __set_bit(DEAD) __set_bit(DONE)
>
> Dues to __set_bit is not atomic, the DEAD or DONE might be lost.
> if the DEAD flag lost, the state SMC_CLOSED will be never be reached
> in smc_close_passive_work:
>
> if (sock_flag(sk, SOCK_DEAD) &&
> smc_close_sent_any_close(conn)) {
> sk->sk_state = SMC_CLOSED;
> } else {
> /* just shutdown, but not yet closed locally */
> sk->sk_state = SMC_APPFINCLOSEWAIT;
> }
>
> Replace sock_set_flags or __set_bit to set_bit will fix this problem.
> Since set_bit is atomic.
>
> Signed-off-by: D. Wythe <alibuda@linux.alibaba.com>
> Reviewed-by: Dust Li <dust.li@linux.alibaba.com>
Fixes tag?
next prev parent reply other threads:[~2023-11-02 10:34 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-02 5:52 [PATCH net v1 0/3] bugfixs for smc D. Wythe
2023-11-02 5:52 ` [PATCH net v1 1/3] net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT D. Wythe
2023-11-02 10:34 ` Wenjia Zhang [this message]
2023-11-02 13:28 ` D. Wythe
2023-11-02 5:52 ` [PATCH net v1 2/3] net/smc: allow cdc msg send rather than drop it with NULL sndbuf_desc D. Wythe
2023-11-02 5:52 ` [PATCH net v1 3/3] net/smc: put sk reference if close work was canceled D. Wythe
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=72b57457-43e1-49f7-9670-08bbf03231e1@linux.ibm.com \
--to=wenjia@linux.ibm.com \
--cc=alibuda@linux.alibaba.com \
--cc=davem@davemloft.net \
--cc=jaka@linux.ibm.com \
--cc=kgraul@linux.ibm.com \
--cc=kuba@kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wintera@linux.ibm.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