Re: [RFC v1 4/4] nvmet-discovery: do not use invalid port

From: Christoph Hellwig
Date: Tue Sep 05 2023 - 12:19:34 EST


On Tue, Aug 29, 2023 at 11:13:49AM +0200, Daniel Wagner wrote:
> The port entry binding might not be existing and thus the req->port
> pointer is not valid.
>
> Reproducer: nvme/005 with active system nvmf-autoconnect systemd service.
>
> Signed-off-by: Daniel Wagner <dwagner@xxxxxxx>
> ---
> drivers/nvme/target/discovery.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/drivers/nvme/target/discovery.c b/drivers/nvme/target/discovery.c
> index 668d257fa986..fc113057cb95 100644
> --- a/drivers/nvme/target/discovery.c
> +++ b/drivers/nvme/target/discovery.c
> @@ -191,6 +191,15 @@ static void nvmet_execute_disc_get_log_page(struct nvmet_req *req)
> goto out;
> }
>
> +
> + /* No port assigned, portentrybinding is missing */

Double new line above, and I think a missing white space before
binding. But I'm still confused how we can get here without req->port
set. Can you try to do a little more analysis as I suspect we have
a deeper problem somewhere.