From: Roland Dreier <roland@xxxxxxxxxxxxxxx> In the two xmit_response functions, the test of the return value from qla_tgt_check_reserve_free_req() was messed up: if QLA_TGT_XMIT_DATA was set, then even if qla_tgt_check_reserve_free_req() failed, the code would go ahead and submit an IOCB to the request queue. This overruns the request queue and confuses the HBA hardware. Fix this so we properly return -EAGAIN and trigger QUEUE FULL handling. Signed-off-by: Roland Dreier <roland@xxxxxxxxxxxxxxx> --- drivers/scsi/qla2xxx/qla_target.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c index 1d3b3b8..bef1a21 100644 --- a/drivers/scsi/qla2xxx/qla_target.c +++ b/drivers/scsi/qla2xxx/qla_target.c @@ -2214,7 +2214,7 @@ static int __qla2xxx_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, uint8 /* Does F/W have an IOCBs for this request */ res = qla_tgt_check_reserve_free_req(vha, full_req_cnt); - if (unlikely(res != 0) && (xmit_type & QLA_TGT_XMIT_DATA)) + if (unlikely(res)) goto out_unmap_unlock; qla2xxx_build_ctio_pkt(&prm, cmd->vha); @@ -2471,7 +2471,7 @@ static int __qla24xx_xmit_response(struct qla_tgt_cmd *cmd, int xmit_type, uint8 /* Does F/W have an IOCBs for this request */ res = qla_tgt_check_reserve_free_req(vha, full_req_cnt); - if (unlikely(res != 0) && (xmit_type & QLA_TGT_XMIT_DATA)) + if (unlikely(res)) goto out_unmap_unlock; res = qla24xx_build_ctio_pkt(&prm, vha); -- 1.7.5.4 -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html