[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZNYLRqZVjr5o3bst@vergenet.net>
Date: Fri, 11 Aug 2023 12:19:50 +0200
From: Simon Horman <horms@...nel.org>
To: Hannes Reinecke <hare@...e.de>
Cc: Christoph Hellwig <hch@....de>, Sagi Grimberg <sagi@...mberg.me>,
Keith Busch <kbusch@...nel.org>, linux-nvme@...ts.infradead.org,
Jakub Kicinski <kuba@...nel.org>,
Eric Dumazet <edumazet@...gle.com>, Paolo Abeni <pabeni@...hat.com>,
netdev@...r.kernel.org
Subject: Re: [PATCH 07/17] nvme-tcp: allocate socket file
On Thu, Aug 10, 2023 at 05:06:20PM +0200, Hannes Reinecke wrote:
> When using the TLS upcall we need to allocate a socket file such
> that the userspace daemon is able to use the socket.
>
> Signed-off-by: Hannes Reinecke <hare@...e.de>
> Reviewed-by: Sagi Grimberg <sagi@...mberg.me>
...
> @@ -1512,6 +1514,7 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid)
> struct nvme_tcp_ctrl *ctrl = to_tcp_ctrl(nctrl);
> struct nvme_tcp_queue *queue = &ctrl->queues[qid];
> int ret, rcv_pdu_size;
> + struct file *sock_file;
>
> mutex_init(&queue->queue_lock);
> queue->ctrl = ctrl;
> @@ -1534,6 +1537,13 @@ static int nvme_tcp_alloc_queue(struct nvme_ctrl *nctrl, int qid)
> goto err_destroy_mutex;
> }
>
> + sock_file = sock_alloc_file(queue->sock, O_CLOEXEC, NULL);
> + if (IS_ERR(sock_file)) {
> + sock_release(queue->sock);
Hi Hannes,
Is it correct to call sock_release() here?
sock_alloc_file() already does so on error.
Flagged by Smatch.
> + queue->sock = NULL;
> + ret = PTR_ERR(sock_file);
> + goto err_destroy_mutex;
> + }
> nvme_tcp_reclassify_socket(queue->sock);
>
> /* Single syn retry */
...
Powered by blists - more mailing lists