From b09642eb1c1b05fbb9fb255e4ad2f34cfb3223a1 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 17 Mar 2010 18:10:16 +0000 Subject: [PATCH] Merge of trunk's r1548: Set bufflen for not expected transfer len case to max to allow, e.g., to get immediate iSCSI data. Otherwise, the iSCSI target will get a too low buffer error and have to close connection. git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/1.0.1.x@1550 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_targ.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index c060a5a62..e13c3cde8 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -632,6 +632,9 @@ static int scst_parse_cmd(struct scst_cmd *cmd) cmd->bufflen); PRINT_BUFF_FLAG(TRACE_MGMT_MINOR, "Suspicious CDB", cmd->cdb, cmd->cdb_len); + /* Needed, e.g., to get immediate iSCSI data */ + cmd->bufflen = max(cmd->bufflen, + cmd->expected_transfer_len); } #endif }