[RFC PATCH 3/7] fcoe: Don't hold fcoe_config_mutex for fcoe_if_destroy or fcoe_interface_cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The fcoe_config_mutex is used to synchronize the hostlist,
to protect EM creation and cloning and to serialize the
creating and deltion of fcoe instances.

It is not needed to protect anything in either
fcoe_if_destroy or fcoe_interface_cleanup. This unnecessary
locking causes later problems with the usage of upcoming
FC Transport API extensions.

This patch simply removes the unnecessary use of the
fcoe_config_mutex.

Signed-off-by: Robert Love <robert.w.love@xxxxxxxxx>
---
 drivers/scsi/fcoe/fcoe.c |   13 +++----------
 1 files changed, 3 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index c701bd9..226cf88 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -1945,18 +1945,13 @@ out_nodev:
  */
 static void fcoe_destroy_work(struct work_struct *work)
 {
-	struct fcoe_port *port;
-	struct fcoe_interface *fcoe;
-
-	port = container_of(work, struct fcoe_port, destroy_work);
-	mutex_lock(&fcoe_config_mutex);
+	struct fcoe_port *port =
+		container_of(work, struct fcoe_port, destroy_work);
+	struct fcoe_interface *fcoe = port->priv;
 
-	fcoe = port->priv;
 	fcoe_if_destroy(port->lport);
 
 	fcoe_interface_cleanup(fcoe);
-
-	mutex_unlock(&fcoe_config_mutex);
 }
 
 /**
@@ -2488,9 +2483,7 @@ static int fcoe_vport_destroy(struct fc_vport *vport)
 	list_del(&vn_port->list);
 	mutex_unlock(&n_port->lp_mutex);
 
-	mutex_lock(&fcoe_config_mutex);
 	fcoe_if_destroy(vn_port);
-	mutex_unlock(&fcoe_config_mutex);
 
 	return 0;
 }

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux