diff mbox

iscsi-target: fix invalid flags in text response

Message ID 1500820425-22039-1-git-send-email-varun@chelsio.com (mailing list archive)
State New, archived
Headers show

Commit Message

Varun Prakash July 23, 2017, 2:33 p.m. UTC
In case of multiple text responses iscsi-target
sets both 'F' and 'C' bit for the final text response
pdu, this issue happens because hdr->flags is not
zeroed out before ORing with 'F' bit.

This patch removes the | operator to fix this issue.

Signed-off-by: Varun Prakash <varun@chelsio.com>
---
 drivers/target/iscsi/iscsi_target.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Nicholas A. Bellinger July 30, 2017, 10:34 p.m. UTC | #1
On Sun, 2017-07-23 at 20:03 +0530, Varun Prakash wrote:
> In case of multiple text responses iscsi-target
> sets both 'F' and 'C' bit for the final text response
> pdu, this issue happens because hdr->flags is not
> zeroed out before ORing with 'F' bit.
> 
> This patch removes the | operator to fix this issue.
> 
> Signed-off-by: Varun Prakash <varun@chelsio.com>
> ---
>  drivers/target/iscsi/iscsi_target.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Also a nice catch.  :)

Applied to target-pending/master.

Thanks Varun.



--
To unsubscribe from this list: send the line "unsubscribe target-devel" 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/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 2688918..12803de 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -3488,9 +3488,9 @@  iscsit_build_text_rsp(struct iscsi_cmd *cmd, struct iscsi_conn *conn,
 		return text_length;
 
 	if (completed) {
-		hdr->flags |= ISCSI_FLAG_CMD_FINAL;
+		hdr->flags = ISCSI_FLAG_CMD_FINAL;
 	} else {
-		hdr->flags |= ISCSI_FLAG_TEXT_CONTINUE;
+		hdr->flags = ISCSI_FLAG_TEXT_CONTINUE;
 		cmd->read_data_done += text_length;
 		if (cmd->targ_xfer_tag == 0xFFFFFFFF)
 			cmd->targ_xfer_tag = session_get_next_ttt(conn->sess);