[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <824b9386-7c95-49d4-995a-d94c35855287@suse.de>
Date: Tue, 19 Dec 2023 12:38:19 +0100
From: Hannes Reinecke <hare@...e.de>
To: Daniel Wagner <dwagner@...e.de>, linux-nvme@...ts.infradead.org
Cc: linux-kernel@...r.kernel.org, Christoph Hellwig <hch@....de>,
Sagi Grimberg <sagi@...mberg.me>, Keith Busch <kbusch@...nel.org>,
James Smart <james.smart@...adcom.com>
Subject: Re: [PATCH v3 12/16] nvmet-fc: do not tack refs on tgtports from
assoc
On 12/18/23 16:31, Daniel Wagner wrote:
> The association life time is tight to the life time of the target port.
tied
> That means we do not take extra a refcount when creating a association.
should not
>
> Signed-off-by: Daniel Wagner <dwagner@...e.de>
> ---
> drivers/nvme/target/fc.c | 8 +-------
> 1 file changed, 1 insertion(+), 7 deletions(-)
>
> diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
> index c243085d6f42..47cecc8c72b2 100644
> --- a/drivers/nvme/target/fc.c
> +++ b/drivers/nvme/target/fc.c
> @@ -1109,12 +1109,9 @@ nvmet_fc_alloc_target_assoc(struct nvmet_fc_tgtport *tgtport, void *hosthandle)
> if (idx < 0)
> goto out_free_assoc;
>
> - if (!nvmet_fc_tgtport_get(tgtport))
> - goto out_ida;
> -
> assoc->hostport = nvmet_fc_alloc_hostport(tgtport, hosthandle);
> if (IS_ERR(assoc->hostport))
> - goto out_put;
> + goto out_ida;
>
> assoc->tgtport = tgtport;
> assoc->a_id = idx;
> @@ -1144,8 +1141,6 @@ nvmet_fc_alloc_target_assoc(struct nvmet_fc_tgtport *tgtport, void *hosthandle)
>
> return assoc;
>
> -out_put:
> - nvmet_fc_tgtport_put(tgtport);
> out_ida:
> ida_free(&tgtport->assoc_cnt, idx);
> out_free_assoc:
> @@ -1182,7 +1177,6 @@ nvmet_fc_target_assoc_free(struct kref *ref)
> dev_info(tgtport->dev,
> "{%d:%d} Association freed\n",
> tgtport->fc_target_port.port_num, assoc->a_id);
> - nvmet_fc_tgtport_put(tgtport);
> kfree(assoc);
> }
>
Otherwise:
Reviewed-by: Hannes Reinecke <hare@...e.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@...e.de +49 911 74053 688
SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg
HRB 36809 (AG Nürnberg), GF: Ivo Totev, Andrew McDonald,
Werner Knoblich
Powered by blists - more mailing lists