summaryrefslogtreecommitdiffstats
path: root/drivers/target
diff options
context:
space:
mode:
authorSagi Grimberg <sagig@mellanox.com>2015-01-26 12:49:06 +0200
committerNicholas Bellinger <nab@linux-iscsi.org>2015-02-04 10:55:33 -0800
commitbe7dcfb683dd7646050666d1f6597ba413a68b22 (patch)
treecc73d0604d454692bb2ace3a8d8b1ed010cc96b1 /drivers/target
parentc1e34b64044318dde74a4cec24a91ff6415f1c48 (diff)
downloadop-kernel-dev-be7dcfb683dd7646050666d1f6597ba413a68b22.zip
op-kernel-dev-be7dcfb683dd7646050666d1f6597ba413a68b22.tar.gz
iscsi-target: Don't over-allocate sendtargets text resp buffer
No reason to allocate a buffer of size bigger than initiator MaxRecvDataSegmentLength. Moreover, we need to respect initiator MRDSL and not send a larger payload. Signed-off-by: Sagi Grimberg <sagig@mellanox.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r--drivers/target/iscsi/iscsi_target.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 5b25faa..75c29b6 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -3397,7 +3397,7 @@ iscsit_build_sendtargets_response(struct iscsi_cmd *cmd,
unsigned char buf[ISCSI_IQN_LEN+12]; /* iqn + "TargetName=" + \0 */
unsigned char *text_in = cmd->text_in_ptr, *text_ptr = NULL;
- buffer_len = max(conn->conn_ops->MaxRecvDataSegmentLength,
+ buffer_len = min(conn->conn_ops->MaxRecvDataSegmentLength,
SENDTARGETS_BUF_LIMIT);
payload = kzalloc(buffer_len, GFP_KERNEL);
OpenPOWER on IntegriCloud