diff mbox

[4/7] bnx2fc: Fix FCP RSP residual parsing.

Message ID 1445283641-7358-5-git-send-email-chad.dupuis@qlogic.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Chad Dupuis Oct. 19, 2015, 7:40 p.m. UTC
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
---
 drivers/scsi/bnx2fc/bnx2fc_io.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Comments

Hannes Reinecke Oct. 21, 2015, 10:23 a.m. UTC | #1
On 10/19/2015 09:40 PM, Chad Dupuis wrote:
> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
> ---
>  drivers/scsi/bnx2fc/bnx2fc_io.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
> index 5d6a81b..877a79a 100644
> --- a/drivers/scsi/bnx2fc/bnx2fc_io.c
> +++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
> @@ -1759,7 +1759,10 @@ static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req,
>  	int fcp_rsp_len = 0;
>  
>  	io_req->fcp_status = FC_GOOD;
> -	io_req->fcp_resid = fcp_rsp->fcp_resid;
> +	io_req->fcp_resid = 0;
> +	if (rsp_flags & (FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER |
> +	    FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER))
> +		io_req->fcp_resid = fcp_rsp->fcp_resid;
>  
>  	io_req->scsi_comp_flags = rsp_flags;
>  	CMD_SCSI_STATUS(sc_cmd) = io_req->cdb_status =
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Tomas Henzl Oct. 22, 2015, 2:54 p.m. UTC | #2
On 19.10.2015 21:40, Chad Dupuis wrote:
> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
> Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>

Reviewed-by: Tomas Henzl <thenzl@redhat.com>

Tomas

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/scsi/bnx2fc/bnx2fc_io.c b/drivers/scsi/bnx2fc/bnx2fc_io.c
index 5d6a81b..877a79a 100644
--- a/drivers/scsi/bnx2fc/bnx2fc_io.c
+++ b/drivers/scsi/bnx2fc/bnx2fc_io.c
@@ -1759,7 +1759,10 @@  static void bnx2fc_parse_fcp_rsp(struct bnx2fc_cmd *io_req,
 	int fcp_rsp_len = 0;
 
 	io_req->fcp_status = FC_GOOD;
-	io_req->fcp_resid = fcp_rsp->fcp_resid;
+	io_req->fcp_resid = 0;
+	if (rsp_flags & (FCOE_FCP_RSP_FLAGS_FCP_RESID_OVER |
+	    FCOE_FCP_RSP_FLAGS_FCP_RESID_UNDER))
+		io_req->fcp_resid = fcp_rsp->fcp_resid;
 
 	io_req->scsi_comp_flags = rsp_flags;
 	CMD_SCSI_STATUS(sc_cmd) = io_req->cdb_status =