diff options
author | James Smart <james.smart@emulex.com> | 2012-03-01 22:36:54 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-03-27 03:26:31 -0400 |
commit | 25090d398e97309931f87682174f377cf0ac1131 (patch) | |
tree | f7f57445007616d22ad2bab6aef2ad08da7fd80d /drivers/scsi | |
parent | d438bd3aef8ec96af02f5cba0c43aaffd35c0b46 (diff) |
[SCSI] lpfc 8.3.30: Fixed panic with extents and small blocks
Fixed system panic when extents enabled with large number of small blocks
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 8945ac04277a..dbaf5b963bff 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -13286,7 +13286,7 @@ lpfc_sli4_post_els_sgl_list_ext(struct lpfc_hba *phba) | |||
13286 | LPFC_MBOXQ_t *mbox; | 13286 | LPFC_MBOXQ_t *mbox; |
13287 | uint32_t reqlen, alloclen, index; | 13287 | uint32_t reqlen, alloclen, index; |
13288 | uint32_t mbox_tmo; | 13288 | uint32_t mbox_tmo; |
13289 | uint16_t rsrc_start, rsrc_size, els_xri_cnt; | 13289 | uint16_t rsrc_start, rsrc_size, els_xri_cnt, post_els_xri_cnt; |
13290 | uint16_t xritag_start = 0, lxri = 0; | 13290 | uint16_t xritag_start = 0, lxri = 0; |
13291 | struct lpfc_rsrc_blks *rsrc_blk; | 13291 | struct lpfc_rsrc_blks *rsrc_blk; |
13292 | int cnt, ttl_cnt, rc = 0; | 13292 | int cnt, ttl_cnt, rc = 0; |
@@ -13308,6 +13308,7 @@ lpfc_sli4_post_els_sgl_list_ext(struct lpfc_hba *phba) | |||
13308 | 13308 | ||
13309 | cnt = 0; | 13309 | cnt = 0; |
13310 | ttl_cnt = 0; | 13310 | ttl_cnt = 0; |
13311 | post_els_xri_cnt = els_xri_cnt; | ||
13311 | list_for_each_entry(rsrc_blk, &phba->sli4_hba.lpfc_xri_blk_list, | 13312 | list_for_each_entry(rsrc_blk, &phba->sli4_hba.lpfc_xri_blk_list, |
13312 | list) { | 13313 | list) { |
13313 | rsrc_start = rsrc_blk->rsrc_start; | 13314 | rsrc_start = rsrc_blk->rsrc_start; |
@@ -13317,11 +13318,12 @@ lpfc_sli4_post_els_sgl_list_ext(struct lpfc_hba *phba) | |||
13317 | "3014 Working ELS Extent start %d, cnt %d\n", | 13318 | "3014 Working ELS Extent start %d, cnt %d\n", |
13318 | rsrc_start, rsrc_size); | 13319 | rsrc_start, rsrc_size); |
13319 | 13320 | ||
13320 | loop_cnt = min(els_xri_cnt, rsrc_size); | 13321 | loop_cnt = min(post_els_xri_cnt, rsrc_size); |
13321 | if (ttl_cnt + loop_cnt >= els_xri_cnt) { | 13322 | if (loop_cnt < post_els_xri_cnt) { |
13322 | loop_cnt = els_xri_cnt - ttl_cnt; | 13323 | post_els_xri_cnt -= loop_cnt; |
13323 | ttl_cnt = els_xri_cnt; | 13324 | ttl_cnt += loop_cnt; |
13324 | } | 13325 | } else |
13326 | ttl_cnt += post_els_xri_cnt; | ||
13325 | 13327 | ||
13326 | mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); | 13328 | mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); |
13327 | if (!mbox) | 13329 | if (!mbox) |