On 2/2/2012 1:03 PM, Neil Horman wrote:
Fix it by adding an ema_lock to list accesses.  Make it an rcu lock so we don't
get Warnings when we try to tx a frame with a spinlock held



  /**
@@ -2166,6 +2182,7 @@ struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct 
fc_lport *lport,
                                           bool (*match)(struct fc_frame *))
  {
        struct fc_exch_mgr_anchor *ema;
+       unsigned long flags;

        ema = kmalloc(sizeof(*ema), GFP_ATOMIC);
        if (!ema)
@@ -2174,8 +2191,10 @@ struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct 
fc_lport *lport,
        ema->mp = mp;
        ema->match = match;
        /* add EM anchor to EM anchors list */
-       list_add_tail(&ema->ema_list,&lport->ema_list);
+       spin_lock_irqsave(&lport->ema_lock, flags);

Neil, why do we need spin_lock_irqsave() for ema_lock? spin_lock_bh() is good enough I think. Probably you're getting the warning because you are using irqsave.



_______________________________________________
devel mailing list
devel@open-fcoe.org
https://lists.open-fcoe.org/mailman/listinfo/devel

Reply via email to