diff options
author | Jayamohan Kallickal <jayamohan.kallickal@emulex.com> | 2014-05-05 21:41:30 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2014-05-28 12:13:17 -0400 |
commit | 11206081ad895d83e717bfe23603168dc307d904 (patch) | |
tree | 3cd6504ccec3c1b97684761418c14b65381435a1 /drivers/scsi/be2iscsi | |
parent | 231881677083647271796bfa4fd385fbae8efaf6 (diff) |
be2iscsi: Fix processing cqe for cxn whose endpoint is freed
During heavy IO in multipath environment with many active sessions
and port-bouncing happening, there is a race condition because of
which beiscsi_prcess_cqe() gets called for a connection whose
endpoint is freed.
Checking endpoint reference for a connection before processing in
beiscsi_process_cq().
Signed-off-by: Minh Tran <minhduc.tran@emulex.com>
Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/be2iscsi')
-rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 554349029628..ac54cf55998f 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
@@ -2110,6 +2110,16 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) | |||
2110 | 2110 | ||
2111 | cri_index = BE_GET_CRI_FROM_CID(cid); | 2111 | cri_index = BE_GET_CRI_FROM_CID(cid); |
2112 | ep = phba->ep_array[cri_index]; | 2112 | ep = phba->ep_array[cri_index]; |
2113 | if (unlikely(ep == NULL)) { | ||
2114 | /* connection has already been freed | ||
2115 | * just move on to next one | ||
2116 | */ | ||
2117 | beiscsi_log(phba, KERN_WARNING, | ||
2118 | BEISCSI_LOG_INIT, | ||
2119 | "BM_%d : proc cqe of disconn ep: cid %d\n", | ||
2120 | cid); | ||
2121 | goto proc_next_cqe; | ||
2122 | } | ||
2113 | beiscsi_ep = ep->dd_data; | 2123 | beiscsi_ep = ep->dd_data; |
2114 | beiscsi_conn = beiscsi_ep->conn; | 2124 | beiscsi_conn = beiscsi_ep->conn; |
2115 | 2125 | ||
@@ -2219,6 +2229,7 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq) | |||
2219 | break; | 2229 | break; |
2220 | } | 2230 | } |
2221 | 2231 | ||
2232 | proc_next_cqe: | ||
2222 | AMAP_SET_BITS(struct amap_sol_cqe, valid, sol, 0); | 2233 | AMAP_SET_BITS(struct amap_sol_cqe, valid, sol, 0); |
2223 | queue_tail_inc(cq); | 2234 | queue_tail_inc(cq); |
2224 | sol = queue_tail_node(cq); | 2235 | sol = queue_tail_node(cq); |