All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fc: add a missing release get taken in nvmet_fc_alloc_target_assoc
@ 2023-01-23 12:37 amit.engel
  2023-01-25 18:50 ` James Smart
  2023-02-01 13:19 ` Christoph Hellwig
  0 siblings, 2 replies; 3+ messages in thread
From: amit.engel @ 2023-01-23 12:37 UTC (permalink / raw)
  To: sagi, linux-nvme; +Cc: amit.engel, Amit Engel

From: Amit Engel <Amit.Engel@dell.com>

As part of nvmet_fc_ls_create_association there is a case where
nvmet_fc_alloc_target_queue fails right after a new
association with admin queue is created.
In this case, no one releases the get taken in nvmet_fc_alloc_target_assoc
This fix is adding the missing get release

Signed-off-by: Amit Engel <Amit.Engel@dell.com>
---
 drivers/nvme/target/fc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
index ab2627e17bb9..1ab6601fdd5c 100644
--- a/drivers/nvme/target/fc.c
+++ b/drivers/nvme/target/fc.c
@@ -1685,8 +1685,10 @@ nvmet_fc_ls_create_association(struct nvmet_fc_tgtport *tgtport,
 		else {
 			queue = nvmet_fc_alloc_target_queue(iod->assoc, 0,
 					be16_to_cpu(rqst->assoc_cmd.sqsize));
-			if (!queue)
+			if (!queue) {
 				ret = VERR_QUEUE_ALLOC_FAIL;
+				nvmet_fc_tgt_a_put(iod->assoc);
+			}
 		}
 	}
 
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] fc: add a missing release get taken in nvmet_fc_alloc_target_assoc
  2023-01-23 12:37 [PATCH] fc: add a missing release get taken in nvmet_fc_alloc_target_assoc amit.engel
@ 2023-01-25 18:50 ` James Smart
  2023-02-01 13:19 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: James Smart @ 2023-01-25 18:50 UTC (permalink / raw)
  To: amit.engel, sagi, linux-nvme

On 1/23/2023 4:37 AM, amit.engel@dell.com wrote:
> From: Amit Engel <Amit.Engel@dell.com>
> 
> As part of nvmet_fc_ls_create_association there is a case where
> nvmet_fc_alloc_target_queue fails right after a new
> association with admin queue is created.
> In this case, no one releases the get taken in nvmet_fc_alloc_target_assoc
> This fix is adding the missing get release
> 
> Signed-off-by: Amit Engel <Amit.Engel@dell.com>
> ---
>   drivers/nvme/target/fc.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/nvme/target/fc.c b/drivers/nvme/target/fc.c
> index ab2627e17bb9..1ab6601fdd5c 100644
> --- a/drivers/nvme/target/fc.c
> +++ b/drivers/nvme/target/fc.c
> @@ -1685,8 +1685,10 @@ nvmet_fc_ls_create_association(struct nvmet_fc_tgtport *tgtport,
>   		else {
>   			queue = nvmet_fc_alloc_target_queue(iod->assoc, 0,
>   					be16_to_cpu(rqst->assoc_cmd.sqsize));
> -			if (!queue)
> +			if (!queue) {
>   				ret = VERR_QUEUE_ALLOC_FAIL;
> +				nvmet_fc_tgt_a_put(iod->assoc);
> +			}
>   		}
>   	}
>   

looks good

Reviewed-by: James Smart <jsmart2021@gmail.com>

-- james




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] fc: add a missing release get taken in nvmet_fc_alloc_target_assoc
  2023-01-23 12:37 [PATCH] fc: add a missing release get taken in nvmet_fc_alloc_target_assoc amit.engel
  2023-01-25 18:50 ` James Smart
@ 2023-02-01 13:19 ` Christoph Hellwig
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2023-02-01 13:19 UTC (permalink / raw)
  To: amit.engel; +Cc: sagi, linux-nvme

Thanks,

applied to nvme-6.2.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-02-01 13:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-23 12:37 [PATCH] fc: add a missing release get taken in nvmet_fc_alloc_target_assoc amit.engel
2023-01-25 18:50 ` James Smart
2023-02-01 13:19 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.