From: <vl...@us...> - 2006-11-02 18:40:15
|
Revision: 26 http://svn.sourceforge.net/scst/?rev=26&view=rev Author: vlnb Date: 2006-11-02 04:10:53 -0800 (Thu, 02 Nov 2006) Log Message: ----------- Serving commands, whose expected data len is less, than maximum, fixed. Particularly, it affected READ CAPACITY(16) from Linux initiators Modified Paths: -------------- trunk/scst/src/scst_cdbprobe.h trunk/scst/src/scst_lib.c trunk/scst/src/scst_targ.c Modified: trunk/scst/src/scst_cdbprobe.h =================================================================== --- trunk/scst/src/scst_cdbprobe.h 2006-11-02 12:08:28 UTC (rev 25) +++ trunk/scst/src/scst_cdbprobe.h 2006-11-02 12:10:53 UTC (rev 26) @@ -385,8 +385,8 @@ SCST_DATA_WRITE, 4, SCST_UNKNOWN_LENGTH, 1, 0}, /*N2! */ {0x93, " M ", "ERASE(16)", SCST_DATA_NONE, 0, SCST_LONG_TIMEOUT, 0, 0}, - {0x9E, "M ", "SERVICE ACTION IN", - SCST_DATA_READ, 4, 0, 0, 0}, + {0x9E, "O ", "SERVICE ACTION IN", + SCST_DATA_READ, 0, 0, 0, 0}, /* 12-bytes length CDB */ {0xA0, "VVVVVVVVVV M ", "REPORT LUN", Modified: trunk/scst/src/scst_lib.c =================================================================== --- trunk/scst/src/scst_lib.c 2006-11-02 12:08:28 UTC (rev 25) +++ trunk/scst/src/scst_lib.c 2006-11-02 12:10:53 UTC (rev 26) @@ -1485,9 +1485,8 @@ } } if (!info_p->transfer_len) { - TRACE(TRACE_SCSI, - "Warning! transfer_len 0, direction %d change on " "%d", - info_p->direction, SCST_DATA_NONE); + TRACE_DBG("Warning! transfer_len 0, direction %d change on %d", + info_p->direction, SCST_DATA_NONE); info_p->direction = SCST_DATA_NONE; } Modified: trunk/scst/src/scst_targ.c =================================================================== --- trunk/scst/src/scst_targ.c 2006-11-02 12:08:28 UTC (rev 25) +++ trunk/scst/src/scst_targ.c 2006-11-02 12:10:53 UTC (rev 26) @@ -374,15 +374,25 @@ TRACE_DBG("Dev handler %s parse() returned %d", dev->handler->name, state); - if (cmd->data_len == -1) - cmd->data_len = cmd->bufflen; - if (state == SCST_CMD_STATE_DEFAULT) state = SCST_CMD_STATE_PREPARE_SPACE; } else state = SCST_CMD_STATE_PREPARE_SPACE; + if (scst_cmd_is_expected_set(cmd)) { + if (cmd->expected_transfer_len < cmd->bufflen) { + TRACE(TRACE_SCSI, "cmd->expected_transfer_len(%d) < " + "cmd->bufflen(%d), using expected_transfer_len " + "instead", cmd->expected_transfer_len, + cmd->bufflen); + cmd->bufflen = cmd->expected_transfer_len; + } + } + + if (cmd->data_len == -1) + cmd->data_len = cmd->bufflen; + #ifdef EXTRACHECKS if (state != SCST_CMD_STATE_NEED_THREAD_CTX) { if (((cmd->data_direction == SCST_DATA_UNKNOWN) && This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |