提交 21f5aa7e 编写于 作者: N Nicholas Bellinger

iscsi-target: Convert incoming PDU payload checks to MaxXmitDataSegmentLength

Now that iscsi-target supports a local configurable MaxXmitDataSegmentLength,
go ahead and make ISCSI_OP_SCSI_CMD, ISCSI_OP_SCSI_DATA_OUT, ISCSI_OP_NOOP_OUT
and ISCSI_OP_TEXT PDU payload checks honor conn_ops->MaxXmitDataSegmentLength.

Cc: Mike Christie <michaelc@cs.wisc.edu>
Cc: Andy Grover <agrover@redhat.com>
Cc: Hannes Reinecke <hare@suse.de>
Cc: Roland Dreier <roland@purestorage.com>
Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
上级 9977bb18
......@@ -869,10 +869,10 @@ static int iscsit_handle_scsi_cmd(
buf, conn);
}
if (payload_length > conn->conn_ops->MaxRecvDataSegmentLength) {
if (payload_length > conn->conn_ops->MaxXmitDataSegmentLength) {
pr_err("DataSegmentLength: %u is greater than"
" MaxRecvDataSegmentLength: %u, protocol error.\n",
payload_length, conn->conn_ops->MaxRecvDataSegmentLength);
" MaxXmitDataSegmentLength: %u, protocol error.\n",
payload_length, conn->conn_ops->MaxXmitDataSegmentLength);
return iscsit_add_reject(ISCSI_REASON_PROTOCOL_ERROR, 1,
buf, conn);
}
......@@ -1216,10 +1216,10 @@ static int iscsit_handle_data_out(struct iscsi_conn *conn, unsigned char *buf)
}
spin_unlock_bh(&conn->sess->session_stats_lock);
if (payload_length > conn->conn_ops->MaxRecvDataSegmentLength) {
if (payload_length > conn->conn_ops->MaxXmitDataSegmentLength) {
pr_err("DataSegmentLength: %u is greater than"
" MaxRecvDataSegmentLength: %u\n", payload_length,
conn->conn_ops->MaxRecvDataSegmentLength);
" MaxXmitDataSegmentLength: %u\n", payload_length,
conn->conn_ops->MaxXmitDataSegmentLength);
return iscsit_add_reject(ISCSI_REASON_PROTOCOL_ERROR, 1,
buf, conn);
}
......@@ -1437,11 +1437,11 @@ static int iscsit_handle_nop_out(
buf, conn);
}
if (payload_length > conn->conn_ops->MaxRecvDataSegmentLength) {
if (payload_length > conn->conn_ops->MaxXmitDataSegmentLength) {
pr_err("NOPOUT Ping Data DataSegmentLength: %u is"
" greater than MaxRecvDataSegmentLength: %u, protocol"
" greater than MaxXmitDataSegmentLength: %u, protocol"
" error.\n", payload_length,
conn->conn_ops->MaxRecvDataSegmentLength);
conn->conn_ops->MaxXmitDataSegmentLength);
return iscsit_add_reject(ISCSI_REASON_PROTOCOL_ERROR, 1,
buf, conn);
}
......@@ -1874,10 +1874,10 @@ static int iscsit_handle_text_cmd(
hdr->cmdsn = be32_to_cpu(hdr->cmdsn);
hdr->exp_statsn = be32_to_cpu(hdr->exp_statsn);
if (payload_length > conn->conn_ops->MaxRecvDataSegmentLength) {
if (payload_length > conn->conn_ops->MaxXmitDataSegmentLength) {
pr_err("Unable to accept text parameter length: %u"
"greater than MaxRecvDataSegmentLength %u.\n",
payload_length, conn->conn_ops->MaxRecvDataSegmentLength);
"greater than MaxXmitDataSegmentLength %u.\n",
payload_length, conn->conn_ops->MaxXmitDataSegmentLength);
return iscsit_add_reject(ISCSI_REASON_PROTOCOL_ERROR, 1,
buf, conn);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册