diff options
author | Bhanu Prakash Gollapudi <bprakash@broadcom.com> | 2011-05-27 14:47:27 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2011-06-29 12:02:09 -0400 |
commit | d36b3279e157641c345b12eddb3db78fb42da80f (patch) | |
tree | a4b1a9a40930728bde81b569f67f2f708384b25d /drivers/scsi/bnx2fc/bnx2fc.h | |
parent | b5a95fe7ef464a67fab6ff870aa740739e788f90 (diff) |
[SCSI] bnx2fc: Fix kernel panic when deleting NPIV ports
Deleting NPIV port causes a kernel panic when the NPIV port is in the same zone
as the physical port and shares the same LUN. This happens due to the fact that
vport destroy and unsolicited ELS are scheduled to run on the same workqueue,
and vport destroy destroys the lport and the unsolicited ELS tries to access
the invalid lport. This patch fixes this issue by maintaining a list of valid
lports and verifying if the lport is valid or not before accessing it.
Signed-off-by: Bhanu Prakash Gollapudi <bprakash@broadcom.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/bnx2fc/bnx2fc.h')
-rw-r--r-- | drivers/scsi/bnx2fc/bnx2fc.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/bnx2fc/bnx2fc.h b/drivers/scsi/bnx2fc/bnx2fc.h index 0a404bfb44fe..856fcbfbb7e9 100644 --- a/drivers/scsi/bnx2fc/bnx2fc.h +++ b/drivers/scsi/bnx2fc/bnx2fc.h | |||
@@ -152,7 +152,6 @@ struct bnx2fc_percpu_s { | |||
152 | spinlock_t fp_work_lock; | 152 | spinlock_t fp_work_lock; |
153 | }; | 153 | }; |
154 | 154 | ||
155 | |||
156 | struct bnx2fc_hba { | 155 | struct bnx2fc_hba { |
157 | struct list_head link; | 156 | struct list_head link; |
158 | struct cnic_dev *cnic; | 157 | struct cnic_dev *cnic; |
@@ -179,6 +178,7 @@ struct bnx2fc_hba { | |||
179 | #define BNX2FC_CTLR_INIT_DONE 1 | 178 | #define BNX2FC_CTLR_INIT_DONE 1 |
180 | #define BNX2FC_CREATE_DONE 2 | 179 | #define BNX2FC_CREATE_DONE 2 |
181 | struct fcoe_ctlr ctlr; | 180 | struct fcoe_ctlr ctlr; |
181 | struct list_head vports; | ||
182 | u8 vlan_enabled; | 182 | u8 vlan_enabled; |
183 | int vlan_id; | 183 | int vlan_id; |
184 | u32 next_conn_id; | 184 | u32 next_conn_id; |
@@ -232,6 +232,11 @@ struct bnx2fc_hba { | |||
232 | 232 | ||
233 | #define bnx2fc_from_ctlr(fip) container_of(fip, struct bnx2fc_hba, ctlr) | 233 | #define bnx2fc_from_ctlr(fip) container_of(fip, struct bnx2fc_hba, ctlr) |
234 | 234 | ||
235 | struct bnx2fc_lport { | ||
236 | struct list_head list; | ||
237 | struct fc_lport *lport; | ||
238 | }; | ||
239 | |||
235 | struct bnx2fc_cmd_mgr { | 240 | struct bnx2fc_cmd_mgr { |
236 | struct bnx2fc_hba *hba; | 241 | struct bnx2fc_hba *hba; |
237 | u16 next_idx; | 242 | u16 next_idx; |
@@ -423,6 +428,7 @@ struct bnx2fc_work { | |||
423 | struct bnx2fc_unsol_els { | 428 | struct bnx2fc_unsol_els { |
424 | struct fc_lport *lport; | 429 | struct fc_lport *lport; |
425 | struct fc_frame *fp; | 430 | struct fc_frame *fp; |
431 | struct bnx2fc_hba *hba; | ||
426 | struct work_struct unsol_els_work; | 432 | struct work_struct unsol_els_work; |
427 | }; | 433 | }; |
428 | 434 | ||