]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/lpfc/lpfc_attr.c
[SCSI] lpfc 8.2.6 : Multiple discovery fixes
[linux-2.6-omap-h63xx.git] / drivers / scsi / lpfc / lpfc_attr.c
index b12a841703ca8f41d92acd754dccb4d8ef8452d5..6917800fc1a768fb590ce7feb26b2448c147afb4 100644 (file)
@@ -1962,7 +1962,11 @@ sysfs_mbox_read(struct kobject *kobj, struct bin_attribute *bin_attr,
 
                phba->sysfs_mbox.mbox->vport = vport;
 
-               if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO) {
+               /* Don't allow mailbox commands to be sent when blocked
+                * or when in the middle of discovery
+                */
+               if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO ||
+                   vport->fc_flag & FC_NDISC_ACTIVE) {
                        sysfs_mbox_idle(phba);
                        spin_unlock_irq(&phba->hbalock);
                        return  -EAGAIN;