From: Hannes Reinecke <hare@suse.de>
To: Simon Horman <horms@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>, Sagi Grimberg <sagi@grimberg.me>,
Keith Busch <kbusch@kernel.org>,
linux-nvme@lists.infradead.org, Jakub Kicinski <kuba@kernel.org>,
Eric Dumazet <edumazet@google.com>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH 07/17] nvme-tcp: allocate socket file
Date: Fri, 11 Aug 2023 12:32:09 +0200 [thread overview]
Message-ID: <df555e96-b603-f024-a099-45fba40d7ea6@suse.de> (raw)
In-Reply-To: <ZNYLRqZVjr5o3bst@vergenet.net>
On 8/11/23 12:19, Simon Horman wrote:
> 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@suse.de>
>> Reviewed-by: Sagi Grimberg <sagi@grimberg.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.
>
Ah, no, you are correct. Will be fixing it up.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions Germany GmbH, Frankenstr. 146, 90461 Nürnberg
Managing Directors: I. Totev, A. Myers, A. McDonald, M. B. Moerman
(HRB 36809, AG Nürnberg)
next prev parent reply other threads:[~2023-08-11 10:32 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-10 15:06 [PATCHv7 00/17] nvme: In-kernel TLS support for TCP Hannes Reinecke
2023-08-10 15:06 ` [PATCH 01/17] nvme-keyring: register '.nvme' keyring Hannes Reinecke
2023-08-10 15:06 ` [PATCH 02/17] nvme-keyring: define a 'psk' keytype Hannes Reinecke
2023-08-10 15:06 ` [PATCH 03/17] nvme: add TCP TSAS definitions Hannes Reinecke
2023-08-10 15:06 ` [PATCH 04/17] nvme-tcp: add definitions for TLS cipher suites Hannes Reinecke
2023-08-10 15:06 ` [PATCH 05/17] nvme-keyring: implement nvme_tls_psk_default() Hannes Reinecke
2023-08-10 15:06 ` [PATCH 06/17] security/keys: export key_lookup() Hannes Reinecke
2023-08-10 15:06 ` [PATCH 07/17] nvme-tcp: allocate socket file Hannes Reinecke
2023-08-11 10:19 ` Simon Horman
2023-08-11 10:32 ` Hannes Reinecke [this message]
2023-08-10 15:06 ` [PATCH 08/17] nvme-tcp: enable TLS handshake upcall Hannes Reinecke
2023-08-10 15:06 ` [PATCH 09/17] nvme-tcp: control message handling for recvmsg() Hannes Reinecke
2023-08-10 15:06 ` [PATCH 10/17] nvme-fabrics: parse options 'keyring' and 'tls_key' Hannes Reinecke
2023-08-10 15:06 ` [PATCH 11/17] nvmet: make TCP sectype settable via configfs Hannes Reinecke
2023-08-11 10:24 ` Simon Horman
2023-08-11 10:32 ` Hannes Reinecke
2023-08-10 15:06 ` [PATCH 12/17] nvmet-tcp: make nvmet_tcp_alloc_queue() a void function Hannes Reinecke
2023-08-10 15:06 ` [PATCH 13/17] nvmet-tcp: allocate socket file Hannes Reinecke
2023-08-10 15:06 ` [PATCH 14/17] nvmet-tcp: reference counting for queues Hannes Reinecke
2023-08-11 10:30 ` Simon Horman
2023-08-11 10:33 ` Hannes Reinecke
2023-08-10 15:06 ` [PATCH 15/17] nvmet: Set 'TREQ' to 'required' when TLS is enabled Hannes Reinecke
2023-08-10 15:06 ` [PATCH 16/17] nvmet-tcp: enable TLS handshake upcall Hannes Reinecke
2023-08-10 15:06 ` [PATCH 17/17] nvmet-tcp: control messages for recvmsg() Hannes Reinecke
-- strict thread matches above, loose matches on Subject: below --
2023-08-11 12:17 [PATCHv8 00/17] nvme: In-kernel TLS support for TCP Hannes Reinecke
2023-08-11 12:17 ` [PATCH 07/17] nvme-tcp: allocate socket file Hannes Reinecke
2023-08-14 11:19 [PATCHv8 00/17] nvme: In-kernel TLS support for TCP Hannes Reinecke
2023-08-14 11:19 ` [PATCH 07/17] nvme-tcp: allocate socket file Hannes Reinecke
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=df555e96-b603-f024-a099-45fba40d7ea6@suse.de \
--to=hare@suse.de \
--cc=edumazet@google.com \
--cc=hch@lst.de \
--cc=horms@kernel.org \
--cc=kbusch@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sagi@grimberg.me \
/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