From: "Maurizio Lombardi" <mlombard@arkamax.eu>
To: "Geliang Tang" <geliang@kernel.org>,
"Christoph Hellwig" <hch@lst.de>,
"Sagi Grimberg" <sagi@grimberg.me>,
"Chaitanya Kulkarni" <kch@nvidia.com>,
"Hannes Reinecke" <hare@suse.de>,
"Keith Busch" <kbusch@kernel.org>,
"Maurizio Lombardi" <mlombard@redhat.com>,
"John Meneghini" <jmeneghi@redhat.com>
Cc: "Geliang Tang" <tanggeliang@kylinos.cn>,
<linux-nvme@lists.infradead.org>
Subject: Re: [PATCH 2/2] nvmet-tcp: remove duplicate cancel_work_sync in release_queue_work
Date: Tue, 19 May 2026 08:39:33 +0200 [thread overview]
Message-ID: <DIMG40N1AP7Y.YMM2POCWCLN3@arkamax.eu> (raw)
In-Reply-To: <246690f4c28333cc83f63081a36b85174465c9b7.1779170418.git.tanggeliang@kylinos.cn>
On Tue May 19, 2026 at 8:10 AM CEST, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> The cancel_work_sync(&queue->io_work) is called twice in
> nvmet_tcp_release_queue_work(). Remove the second one as it is redundant.
>
> Fixes: a208fc5672177 ("nvmet-tcp: fix a race condition between release_queue and io_work")
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
> drivers/nvme/target/tcp.c | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/drivers/nvme/target/tcp.c b/drivers/nvme/target/tcp.c
> index 8a243d22a511..af7ce384b3cf 100644
> --- a/drivers/nvme/target/tcp.c
> +++ b/drivers/nvme/target/tcp.c
> @@ -1616,7 +1616,6 @@ static void nvmet_tcp_release_queue_work(struct work_struct *w)
> nvmet_tcp_uninit_data_in_cmds(queue);
> nvmet_sq_destroy(&queue->nvme_sq);
> nvmet_cq_put(&queue->nvme_cq);
> - cancel_work_sync(&queue->io_work);
> nvmet_tcp_free_cmd_data_in_buffers(queue);
> /* ->sock will be released by fput() */
> fput(queue->sock->file);
I think that the second cancel_work_sync() is done because
nvmet_sq_destroy() can potentially end up calling
nvmet_req_complete()
nvmet_sq_destroy() -> nvmet_async_events_failall() ->
nvmet_req_complete() -> queue_response()
and this kicks a new io_work.
Maurizio
next prev parent reply other threads:[~2026-05-19 6:39 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 6:10 [PATCH 0/2] nvmet-tcp: two small fixes Geliang Tang
2026-05-19 6:10 ` [PATCH 1/2] nvmet-tcp: check return value of nvmet_tcp_set_queue_sock Geliang Tang
2026-05-19 8:44 ` Hannes Reinecke
2026-05-19 6:10 ` [PATCH 2/2] nvmet-tcp: remove duplicate cancel_work_sync in release_queue_work Geliang Tang
2026-05-19 6:39 ` Maurizio Lombardi [this message]
2026-05-19 7:52 ` Geliang Tang
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=DIMG40N1AP7Y.YMM2POCWCLN3@arkamax.eu \
--to=mlombard@arkamax.eu \
--cc=geliang@kernel.org \
--cc=hare@suse.de \
--cc=hch@lst.de \
--cc=jmeneghi@redhat.com \
--cc=kbusch@kernel.org \
--cc=kch@nvidia.com \
--cc=linux-nvme@lists.infradead.org \
--cc=mlombard@redhat.com \
--cc=sagi@grimberg.me \
--cc=tanggeliang@kylinos.cn \
/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