[RHEL7,COMMIT] ms/iscsi-target: fix invalid flags in text response

Submitted by Konstantin Khorenko on April 2, 2018, 2:28 p.m.


Message ID 201804021428.w32ESUHg024730@finist_ce7.work
State New
Series "target: backport bug fixes from the upstream kernel"
Headers show

Commit Message

Konstantin Khorenko April 2, 2018, 2:28 p.m.
The commit is pushed to "branch-rh7-3.10.0-693.21.1.vz7.46.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-693.21.1.vz7.46.2
commit 8e7148d94eff27bd1eccc825c94df93d0ea43f52
Author: Varun Prakash <varun@chelsio.com>
Date:   Mon Apr 2 17:28:30 2018 +0300

    ms/iscsi-target: fix invalid flags in text response
    ML: 310d40a973c560a24c79f84cb5f16dc540a05686
    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>
    Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
    Signed-off-by: Andrei Vagin <avagin@openvz.org>
 drivers/target/iscsi/iscsi_target.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index aeba04aee4bb..2ec68f26e4d5 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -3490,9 +3490,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;
 		cmd->read_data_done += text_length;
 		if (cmd->targ_xfer_tag == 0xFFFFFFFF)
 			cmd->targ_xfer_tag = session_get_next_ttt(conn->sess);