From bcd0db848bce443980e6b4252d3208cd22049df5 Mon Sep 17 00:00:00 2001 From: Yi Zou Date: Mon, 24 Sep 2012 11:52:50 -0700 Subject: [PATCH] --- yaml --- r: 334113 b: refs/heads/master c: 3b64b1881143ce9e461c211cc81acc72d0cdc476 h: refs/heads/master i: 334111: 0544733822fbecdcff6f1b2d14ea78394df989c9 v: v3 --- [refs] | 2 +- trunk/drivers/scsi/libfc/fc_fcp.c | 3 ++- trunk/include/scsi/fc/fc_fcp.h | 6 ++++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 1d329ef93bae..17bee3d759b1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 31c37a6f21d86e6bca095b71d603ed543ae070ad +refs/heads/master: 3b64b1881143ce9e461c211cc81acc72d0cdc476 diff --git a/trunk/drivers/scsi/libfc/fc_fcp.c b/trunk/drivers/scsi/libfc/fc_fcp.c index 14243fa5f8e8..fcb9d0b20ee4 100644 --- a/trunk/drivers/scsi/libfc/fc_fcp.c +++ b/trunk/drivers/scsi/libfc/fc_fcp.c @@ -851,7 +851,8 @@ static void fc_fcp_resp(struct fc_fcp_pkt *fsp, struct fc_frame *fp) fc_rp_info = (struct fcp_resp_rsp_info *)(rp_ex + 1); if (flags & FCP_RSP_LEN_VAL) { respl = ntohl(rp_ex->fr_rsp_len); - if (respl != sizeof(*fc_rp_info)) + if ((respl != FCP_RESP_RSP_INFO_LEN4) && + (respl != FCP_RESP_RSP_INFO_LEN8)) goto len_err; if (fsp->wait_for_comp) { /* Abuse cdb_status for rsp code */ diff --git a/trunk/include/scsi/fc/fc_fcp.h b/trunk/include/scsi/fc/fc_fcp.h index 0d7d67e96d43..9c8702942b61 100644 --- a/trunk/include/scsi/fc/fc_fcp.h +++ b/trunk/include/scsi/fc/fc_fcp.h @@ -127,6 +127,9 @@ struct fcp_txrdy { * * All response frames will always contain the fcp_resp template. Some * will also include the fcp_resp_len template. + * + * From Table 23, the FCP_RSP_INFO can either be 4 bytes or 8 bytes, both + * are valid length. */ struct fcp_resp { __u8 _fr_resvd[8]; /* reserved */ @@ -156,6 +159,9 @@ struct fcp_resp_rsp_info { __u8 _fr_resvd2[4]; /* reserved */ }; +#define FCP_RESP_RSP_INFO_LEN4 4 /* without reserved field */ +#define FCP_RESP_RSP_INFO_LEN8 8 /* with reserved field */ + struct fcp_resp_with_ext { struct fcp_resp resp; struct fcp_resp_ext ext;