提交 733bb6a7 编写于 作者: M Mike Christie 提交者: James Bottomley

[SCSI] iscsi: iscsi response fix

from Wang Zhenyu:

Must check SCSI CMD and R2T response according to the spec
Signed-off-by: NMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: NAlex Aizman <itn780@yahoo.com>
Signed-off-by: NDmitry Yusupov <dmitry_yus@yahoo.com>
Signed-off-by: NJames Bottomley <James.Bottomley@SteelEye.com>
上级 e6273993
......@@ -642,9 +642,7 @@ iscsi_hdr_recv(struct iscsi_conn *conn)
switch(conn->in.opcode) {
case ISCSI_OP_SCSI_CMD_RSP:
BUG_ON((void*)ctask != ctask->sc->SCp.ptr);
if (ctask->hdr.flags & ISCSI_FLAG_CMD_WRITE)
rc = iscsi_cmd_rsp(conn, ctask);
else if (!conn->in.datalen)
if (!conn->in.datalen)
rc = iscsi_cmd_rsp(conn, ctask);
else
/*
......@@ -666,8 +664,7 @@ iscsi_hdr_recv(struct iscsi_conn *conn)
break;
case ISCSI_OP_R2T:
BUG_ON((void*)ctask != ctask->sc->SCp.ptr);
if (ctask->hdr.flags & ISCSI_FLAG_CMD_WRITE &&
ctask->sc->sc_data_direction == DMA_TO_DEVICE)
if (ctask->sc->sc_data_direction == DMA_TO_DEVICE)
rc = iscsi_r2t_rsp(conn, ctask);
else
rc = ISCSI_ERR_PROTO;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册