All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] elx: efct: fix vport list linkage in lio backend
@ 2021-06-19 15:57 James Smart
  2021-06-23  1:13 ` Martin K. Petersen
  2021-06-29  4:10 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: James Smart @ 2021-06-19 15:57 UTC (permalink / raw)
  To: linux-scsi; +Cc: ram.vegesna, dan.carpenter, James Smart, James Smart

vport is linked onto the drivers vport list at allocation, but
failure path fails to removed from the list.

Change location of linkage until after complete vport completion.

Fixes: 692e5d73a811 ("scsi: elx: efct: LIO backend interface routines")
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Co-developed-by: Ram Vegesna <ram.vegesna@broadcom.com>
Signed-off-by: Ram Vegesna <ram.vegesna@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
---
 drivers/scsi/elx/efct/efct_lio.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/scsi/elx/efct/efct_lio.c b/drivers/scsi/elx/efct/efct_lio.c
index e1bab2b17e4d..6ad5168a86ca 100644
--- a/drivers/scsi/elx/efct/efct_lio.c
+++ b/drivers/scsi/elx/efct/efct_lio.c
@@ -832,10 +832,6 @@ efct_lio_npiv_make_nport(struct target_fabric_configfs *tf,
 	}
 
 	vport_list->lio_vport = lio_vport;
-	spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags);
-	INIT_LIST_HEAD(&vport_list->list_entry);
-	list_add_tail(&vport_list->list_entry, &efct->tgt_efct.vport_list);
-	spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags);
 
 	memset(&vport_id, 0, sizeof(vport_id));
 	vport_id.port_name = npiv_wwpn;
@@ -853,6 +849,10 @@ efct_lio_npiv_make_nport(struct target_fabric_configfs *tf,
 	}
 
 	lio_vport->fc_vport = new_fc_vport;
+	spin_lock_irqsave(&efct->tgt_efct.efct_lio_lock, flags);
+	INIT_LIST_HEAD(&vport_list->list_entry);
+	list_add_tail(&vport_list->list_entry, &efct->tgt_efct.vport_list);
+	spin_unlock_irqrestore(&efct->tgt_efct.efct_lio_lock, flags);
 
 	return &lio_vport->vport_wwn;
 }
-- 
2.26.2


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

* Re: [PATCH] elx: efct: fix vport list linkage in lio backend
  2021-06-19 15:57 [PATCH] elx: efct: fix vport list linkage in lio backend James Smart
@ 2021-06-23  1:13 ` Martin K. Petersen
  2021-06-29  4:10 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-06-23  1:13 UTC (permalink / raw)
  To: James Smart; +Cc: linux-scsi, ram.vegesna, dan.carpenter, James Smart


James,

> vport is linked onto the drivers vport list at allocation, but
> failure path fails to removed from the list.

Applied to 5.14/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] elx: efct: fix vport list linkage in lio backend
  2021-06-19 15:57 [PATCH] elx: efct: fix vport list linkage in lio backend James Smart
  2021-06-23  1:13 ` Martin K. Petersen
@ 2021-06-29  4:10 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-06-29  4:10 UTC (permalink / raw)
  To: linux-scsi, James Smart
  Cc: Martin K . Petersen, James Smart, ram.vegesna, dan.carpenter

On Sat, 19 Jun 2021 08:57:29 -0700, James Smart wrote:

> vport is linked onto the drivers vport list at allocation, but
> failure path fails to removed from the list.
> 
> Change location of linkage until after complete vport completion.

Applied to 5.14/scsi-queue, thanks!

[1/1] elx: efct: fix vport list linkage in lio backend
      https://git.kernel.org/mkp/scsi/c/f7c95d7460e3

-- 
Martin K. Petersen	Oracle Linux Engineering

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

end of thread, other threads:[~2021-06-29  4:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-19 15:57 [PATCH] elx: efct: fix vport list linkage in lio backend James Smart
2021-06-23  1:13 ` Martin K. Petersen
2021-06-29  4:10 ` Martin K. Petersen

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.