[PATCH 1/3] Resolve circular lock warning and is_vendor check

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

 



Resolve circular lock between fcoe_config_mutex and ft_mutex.
Fixed the is_vendor check to add vendor drivers to the head.

Signed-off-by: Bhanu Prakash Gollapudi <bprakash@xxxxxxxxxxxx>
---
 drivers/scsi/fcoe/fcoe.c              |    8 ++++----
 drivers/scsi/fcoe/libfcoe_transport.c |    2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/scsi/fcoe/fcoe.c b/drivers/scsi/fcoe/fcoe.c
index 8382f5a..711d441 100644
--- a/drivers/scsi/fcoe/fcoe.c
+++ b/drivers/scsi/fcoe/fcoe.c
@@ -2349,16 +2349,16 @@ static int __init fcoe_init(void)
 	unsigned int cpu;
 	int rc = 0;
 
-	mutex_lock(&fcoe_config_mutex);
-
 	/* register as a fcoe transport */
 	rc = fcoe_transport_attach(&fcoe_sw_transport);
 	if (rc) {
 		printk(KERN_ERR "failed to register an fcoe transport, check "
 			"if libfcoe is loaded\n");
-		goto out_unlock;
+		goto out_return;
 	}
 
+	mutex_lock(&fcoe_config_mutex);
+
 	for_each_possible_cpu(cpu) {
 		p = &per_cpu(fcoe_percpu, cpu);
 		skb_queue_head_init(&p->fcoe_rx_list);
@@ -2386,8 +2386,8 @@ out_free:
 	for_each_online_cpu(cpu) {
 		fcoe_percpu_thread_destroy(cpu);
 	}
-out_unlock:
 	mutex_unlock(&fcoe_config_mutex);
+out_return:
 	return rc;
 }
 module_init(fcoe_init);
diff --git a/drivers/scsi/fcoe/libfcoe_transport.c b/drivers/scsi/fcoe/libfcoe_transport.c
index fec0fb8..8fd29ea 100644
--- a/drivers/scsi/fcoe/libfcoe_transport.c
+++ b/drivers/scsi/fcoe/libfcoe_transport.c
@@ -127,7 +127,7 @@ int fcoe_transport_attach(struct fcoe_transport *ft)
 	}
 
 	/* Add vendor specific transport to the head */
-	if (!ft->is_vendor)
+	if (ft->is_vendor)
 		list_add(&ft->list, &fcoe_transports);
 	else
 		list_add_tail(&ft->list, &fcoe_transports);
-- 
1.7.0.6




--
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