[PATCH] nvmet-tcp: remove a redundant line in nvmet_tcp_release_queue_work

Maurizio Lombardi mlombard at bsdbackstore.eu
Mon Oct 6 23:26:48 PDT 2025


On Mon Oct 6, 2025 at 7:59 PM CEST, Tomas Henzl wrote:
> cancel_work_sync(&queue->io_work) is called twice, remove the
> second instance.
>
> Signed-off-by: Tomas Henzl <thenzl at redhat.com>
> ---
>  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 470bf37e5a63..a1d0f6b18b2c 100644
> --- a/drivers/nvme/target/tcp.c
> +++ b/drivers/nvme/target/tcp.c
> @@ -1577,7 +1577,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 am not sure it's safe to remove it because io_work can potentially
re-enqueue itself.

The second call to cancel_work_sync(), after rcv_state is set to
NVMET_TCP_RECV_ERR, should ensure that no more "io_work"s are pending
on the workqueue.

Maurizio



More information about the Linux-nvme mailing list