Commit e074d20f authored by Jayamohan Kallickal's avatar Jayamohan Kallickal Committed by James Bottomley

[SCSI] be2iscsi: Fix the MCCQ count leakage

When MBX CMD is posted in MCCQ and if command times out,during
mccq resource cleanup for the timed out command  mccq->count
was not decremented. The led to BUG_ON being hit.
Signed-off-by: default avatarJohn Soni Jose <sony.john-n@emulex.com>
Signed-off-by: default avatarJayamohan Kallickal <jayamohan.kallickal@emulex.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
parent 15a90fe0
...@@ -174,6 +174,10 @@ int beiscsi_mccq_compl(struct beiscsi_hba *phba, ...@@ -174,6 +174,10 @@ int beiscsi_mccq_compl(struct beiscsi_hba *phba,
BEISCSI_LOG_CONFIG, BEISCSI_LOG_CONFIG,
"BC_%d : MBX Cmd Completion timed out\n"); "BC_%d : MBX Cmd Completion timed out\n");
rc = -EAGAIN; rc = -EAGAIN;
/* decrement the mccq used count */
atomic_dec(&phba->ctrl.mcc_obj.q.used);
goto release_mcc_tag; goto release_mcc_tag;
} else } else
rc = 0; rc = 0;
...@@ -699,7 +703,7 @@ struct be_mcc_wrb *wrb_from_mccq(struct beiscsi_hba *phba) ...@@ -699,7 +703,7 @@ struct be_mcc_wrb *wrb_from_mccq(struct beiscsi_hba *phba)
struct be_queue_info *mccq = &phba->ctrl.mcc_obj.q; struct be_queue_info *mccq = &phba->ctrl.mcc_obj.q;
struct be_mcc_wrb *wrb; struct be_mcc_wrb *wrb;
BUG_ON(atomic_read(&mccq->used) >= mccq->len); WARN_ON(atomic_read(&mccq->used) >= mccq->len);
wrb = queue_head_node(mccq); wrb = queue_head_node(mccq);
memset(wrb, 0, sizeof(*wrb)); memset(wrb, 0, sizeof(*wrb));
wrb->tag0 = (mccq->head & 0x000000FF) << 16; wrb->tag0 = (mccq->head & 0x000000FF) << 16;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment