|
From: <vl...@us...> - 2010-01-08 16:14:57
|
Revision: 1438
http://scst.svn.sourceforge.net/scst/?rev=1438&view=rev
Author: vlnb
Date: 2010-01-08 16:14:49 +0000 (Fri, 08 Jan 2010)
Log Message:
-----------
Mark "completed" should be cleared from being retried commands.
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2010-01-08 16:11:13 UTC (rev 1437)
+++ trunk/scst/src/scst_targ.c 2010-01-08 16:14:49 UTC (rev 1438)
@@ -2418,6 +2418,7 @@
cmd->msg_status = 0;
cmd->host_status = DID_OK;
cmd->driver_status = 0;
+ cmd->completed = 0;
mempool_free(cmd->sense,
scst_sense_mempool);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2010-01-11 19:27:18
|
Revision: 1448
http://scst.svn.sourceforge.net/scst/?rev=1448&view=rev
Author: vlnb
Date: 2010-01-11 19:27:07 +0000 (Mon, 11 Jan 2010)
Log Message:
-----------
Let's experimantally disable SCST_MAX_DEV_COMMANDS and cmd->dev_cmd_count functionality and see if users will complain about it. If not, we will remove it.
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2010-01-11 19:16:38 UTC (rev 1447)
+++ trunk/scst/src/scst_targ.c 2010-01-11 19:27:07 UTC (rev 1448)
@@ -33,11 +33,16 @@
#include "scst.h"
#include "scst_priv.h"
-#if 0 /* Temporary, left for future performance investigations */
+#if 0 /* Temporary left for future performance investigations */
/* Deleting it don't forget to delete write_cmd_count */
#define CONFIG_SCST_ORDERED_READS
#endif
+#if 0 /* Let's disable it for now to see if users will complain about it */
+/* Deleting it don't forget to delete write_cmd_count */
+#define CONFIG_SCST_PER_DEVICE_CMD_COUNT_LIMIT
+#endif
+
static void scst_cmd_set_sn(struct scst_cmd *cmd);
static int __scst_init_cmd(struct scst_cmd *cmd);
static void scst_finish_cmd_mgmt(struct scst_cmd *cmd);
@@ -2869,7 +2874,9 @@
* latency, so we should decrement them after cmd completed.
*/
atomic_dec(&cmd->tgt_dev->tgt_dev_cmd_count);
+#ifdef CONFIG_SCST_PER_DEVICE_CMD_COUNT_LIMIT
atomic_dec(&cmd->dev->dev_cmd_count);
+#endif
#ifdef CONFIG_SCST_ORDERED_READS
/* If expected values not set, expected direction is UNKNOWN */
if (cmd->expected_data_direction & SCST_DATA_WRITE)
@@ -3322,6 +3329,7 @@
failure = true;
}
+#ifdef CONFIG_SCST_PER_DEVICE_CMD_COUNT_LIMIT
cnt = atomic_inc_return(&cmd->dev->dev_cmd_count);
if (unlikely(cnt > SCST_MAX_DEV_COMMANDS)) {
if (!failure) {
@@ -3335,6 +3343,7 @@
failure = true;
}
}
+#endif
#ifdef CONFIG_SCST_ORDERED_READS
/* If expected values not set, expected direction is UNKNOWN */
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2010-01-14 12:59:39
|
Revision: 1465
http://scst.svn.sourceforge.net/scst/?rev=1465&view=rev
Author: vlnb
Date: 2010-01-14 12:59:13 +0000 (Thu, 14 Jan 2010)
Log Message:
-----------
Improve handling of aborts of done commands
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2010-01-13 20:19:54 UTC (rev 1464)
+++ trunk/scst/src/scst_targ.c 2010-01-14 12:59:13 UTC (rev 1465)
@@ -47,7 +47,7 @@
static int __scst_init_cmd(struct scst_cmd *cmd);
static void scst_finish_cmd_mgmt(struct scst_cmd *cmd);
static struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess,
- uint64_t tag);
+ uint64_t tag, bool to_abort);
static void scst_process_redirect_cmd(struct scst_cmd *cmd,
enum scst_exec_context context, int check_retries);
@@ -4435,7 +4435,7 @@
struct scst_cmd *cmd;
spin_lock_irq(&sess->sess_list_lock);
- cmd = __scst_find_cmd_by_tag(sess, mcmd->tag);
+ cmd = __scst_find_cmd_by_tag(sess, mcmd->tag, true);
if (cmd == NULL) {
TRACE_MGMT_DBG("ABORT TASK: command "
"for tag %llu not found",
@@ -5732,9 +5732,9 @@
/* Called under sess->sess_list_lock */
static struct scst_cmd *__scst_find_cmd_by_tag(struct scst_session *sess,
- uint64_t tag)
+ uint64_t tag, bool to_abort)
{
- struct scst_cmd *cmd = NULL;
+ struct scst_cmd *cmd, *res = NULL;
TRACE_ENTRY();
@@ -5742,24 +5742,46 @@
TRACE_DBG("%s (sess=%p, tag=%llu)", "Searching in sess cmd list",
sess, (long long unsigned int)tag);
+
list_for_each_entry(cmd, &sess->sess_cmd_list,
sess_cmd_list_entry) {
- /*
- * We must not count done commands, because they were
- * submitted for transmittion. Otherwise we can have a race,
- * when for some reason cmd's release delayed after
- * transmittion and initiator sends cmd with the same tag =>
- * it can be possible that a wrong cmd will be returned.
- */
- if (cmd->done)
- continue;
- if (cmd->tag == tag)
- goto out;
+ if (cmd->tag == tag) {
+ /*
+ * We must not count done commands, because
+ * they were submitted for transmittion.
+ * Otherwise we can have a race, when for
+ * some reason cmd's release delayed
+ * after transmittion and initiator sends
+ * cmd with the same tag => it can be possible
+ * that a wrong cmd will be returned.
+ */
+ if (cmd->done) {
+ if (to_abort) {
+ /*
+ * We should return the latest not
+ * aborted cmd with this tag.
+ */
+ if (res == NULL)
+ res = cmd;
+ else {
+ if (test_bit(SCST_CMD_ABORTED,
+ &res->cmd_flags)) {
+ res = cmd;
+ } else if (!test_bit(SCST_CMD_ABORTED,
+ &cmd->cmd_flags))
+ res = cmd;
+ }
+ }
+ continue;
+ } else {
+ res = cmd;
+ break;
+ }
+ }
}
- cmd = NULL;
-out:
+
TRACE_EXIT();
- return cmd;
+ return res;
}
struct scst_cmd *scst_find_cmd(struct scst_session *sess, void *data,
@@ -5808,7 +5830,7 @@
unsigned long flags;
struct scst_cmd *cmd;
spin_lock_irqsave(&sess->sess_list_lock, flags);
- cmd = __scst_find_cmd_by_tag(sess, tag);
+ cmd = __scst_find_cmd_by_tag(sess, tag, false);
spin_unlock_irqrestore(&sess->sess_list_lock, flags);
return cmd;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2010-03-17 17:40:23
|
Revision: 1548
http://scst.svn.sourceforge.net/scst/?rev=1548&view=rev
Author: vlnb
Date: 2010-03-17 17:40:17 +0000 (Wed, 17 Mar 2010)
Log Message:
-----------
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.
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2010-03-17 14:03:41 UTC (rev 1547)
+++ trunk/scst/src/scst_targ.c 2010-03-17 17:40:17 UTC (rev 1548)
@@ -632,6 +632,9 @@
cmd->bufflen);
PRINT_BUFF_FLAG(TRACE_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
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bva...@us...> - 2010-04-29 06:43:55
|
Revision: 1665
http://scst.svn.sourceforge.net/scst/?rev=1665&view=rev
Author: bvassche
Date: 2010-04-29 06:43:49 +0000 (Thu, 29 Apr 2010)
Log Message:
-----------
Fixed a checkpatch complaint about spaces being used for indentation.
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2010-04-29 06:35:35 UTC (rev 1664)
+++ trunk/scst/src/scst_targ.c 2010-04-29 06:43:49 UTC (rev 1665)
@@ -796,7 +796,7 @@
if (likely(!scst_is_cmd_fully_local(cmd)) &&
(dev->handler->alloc_data_buf != NULL)) {
- int state;
+ int state;
if (unlikely(!dev->handler->alloc_data_buf_atomic &&
scst_cmd_atomic(cmd))) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bva...@us...> - 2010-07-21 10:50:04
|
Revision: 1847
http://scst.svn.sourceforge.net/scst/?rev=1847&view=rev
Author: bvassche
Date: 2010-07-21 10:49:58 +0000 (Wed, 21 Jul 2010)
Log Message:
-----------
Fixed a single-letter typo in a source code comment.
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2010-07-20 19:44:39 UTC (rev 1846)
+++ trunk/scst/src/scst_targ.c 2010-07-21 10:49:58 UTC (rev 1847)
@@ -1292,7 +1292,7 @@
* scst_rx_data() - the command's data received
* @cmd: SCST commands
* @status: data receiving completion status
- * @pref_context: preferred command execition context
+ * @pref_context: preferred command execution context
*
* Description:
* Notifies SCST that the driver received all the necessary data
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2010-08-05 19:41:58
|
Revision: 1937
http://scst.svn.sourceforge.net/scst/?rev=1937&view=rev
Author: vlnb
Date: 2010-08-05 19:41:52 +0000 (Thu, 05 Aug 2010)
Log Message:
-----------
Let's proceed as implicit HQ only SIMPLE commands.
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2010-08-05 13:57:32 UTC (rev 1936)
+++ trunk/scst/src/scst_targ.c 2010-08-05 19:41:52 UTC (rev 1937)
@@ -3662,7 +3662,8 @@
TRACE_ENTRY();
- if (scst_is_implicit_hq(cmd)) {
+ if (scst_is_implicit_hq(cmd) &&
+ likely(cmd->queue_type == SCST_CMD_QUEUE_SIMPLE)) {
TRACE_SN("Implicit HQ cmd %p", cmd);
cmd->queue_type = SCST_CMD_QUEUE_HEAD_OF_QUEUE;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2010-10-18 18:39:06
|
Revision: 2422
http://scst.svn.sourceforge.net/scst/?rev=2422&view=rev
Author: vlnb
Date: 2010-10-18 18:39:00 +0000 (Mon, 18 Oct 2010)
Log Message:
-----------
Fix possible crash on ABORT TASK SET TM command
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2010-10-18 18:31:03 UTC (rev 2421)
+++ trunk/scst/src/scst_targ.c 2010-10-18 18:39:00 UTC (rev 2422)
@@ -4853,8 +4853,12 @@
__scst_abort_task_set(mcmd, tgt_dev);
- if (atomic_dec_and_test(&mcmd->origin_pr_cmd->pr_abort_counter->pr_aborting_cnt))
- complete_all(&mcmd->origin_pr_cmd->pr_abort_counter->pr_aborting_cmpl);
+ if (mcmd->fn == SCST_PR_ABORT_ALL) {
+ struct scst_pr_abort_all_pending_mgmt_cmds_counter *pr_cnt =
+ mcmd->origin_pr_cmd->pr_abort_counter;
+ if (atomic_dec_and_test(&pr_cnt->pr_aborting_cnt))
+ complete_all(&pr_cnt->pr_aborting_cmpl);
+ }
tm_dbg_task_mgmt(mcmd->mcmd_tgt_dev->dev, "ABORT TASK SET/PR ABORT", 0);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2010-11-03 12:42:16
|
Revision: 2578
http://scst.svn.sourceforge.net/scst/?rev=2578&view=rev
Author: vlnb
Date: 2010-11-03 12:42:10 +0000 (Wed, 03 Nov 2010)
Log Message:
-----------
Cleanup
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2010-11-02 20:15:58 UTC (rev 2577)
+++ trunk/scst/src/scst_targ.c 2010-11-03 12:42:10 UTC (rev 2578)
@@ -697,9 +697,7 @@
TRACE(TRACE_MINOR, "Warning: expected "
"transfer length %d for opcode 0x%02x "
"(handler %s, target %s) doesn't match "
- "decoded value %d. Faulty initiator "
- "(e.g. VMware is known to be such) or "
- "scst_scsi_op_table should be updated?",
+ "decoded value %d",
cmd->expected_transfer_len, cmd->cdb[0],
dev->handler->name, cmd->tgtt->name,
cmd->bufflen);
@@ -713,9 +711,7 @@
TRACE(TRACE_MINOR, "Warning: expected bidirectional OUT "
"transfer length %d for opcode 0x%02x "
"(handler %s, target %s) doesn't match "
- "decoded value %d. Faulty initiator "
- "(e.g. VMware is known to be such) or "
- "scst_scsi_op_table should be updated?",
+ "decoded value %d",
cmd->expected_out_transfer_len, cmd->cdb[0],
dev->handler->name, cmd->tgtt->name,
cmd->out_bufflen);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2011-01-13 18:56:18
|
Revision: 3215
http://scst.svn.sourceforge.net/scst/?rev=3215&view=rev
Author: vlnb
Date: 2011-01-13 18:56:11 +0000 (Thu, 13 Jan 2011)
Log Message:
-----------
More context fixes and cleanups
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2011-01-13 14:25:09 UTC (rev 3214)
+++ trunk/scst/src/scst_targ.c 2011-01-13 18:56:11 UTC (rev 3215)
@@ -800,7 +800,7 @@
#ifndef CONFIG_SCST_TEST_IO_IN_SIRQ
/*
- * We shouldn't allow atomic command to the exec stage. It shouldn't
+ * We can't allow atomic command on the exec stages. It shouldn't
* be because of the SCST_TGT_DEV_AFTER_* optimization, but during
* parsing data_direction can change, so we need to recheck.
*/
@@ -1147,10 +1147,10 @@
if ((tgtt->rdy_to_xfer == NULL) || unlikely(cmd->internal)) {
cmd->state = SCST_CMD_STATE_TGT_PRE_EXEC;
#ifndef CONFIG_SCST_TEST_IO_IN_SIRQ
- /* We shouldn't allow atomic command to the exec stage */
+ /* We can't allow atomic command on the exec stages */
if (scst_cmd_atomic(cmd)) {
TRACE_DBG("NULL rdy_to_xfer() and atomic context, "
- " rescheduling (cmd %p)", cmd);
+ "rescheduling (cmd %p)", cmd);
res = SCST_CMD_STATE_RES_NEED_THREAD;
} else
#endif
@@ -2980,8 +2980,14 @@
SCST_LOAD_SENSE(scst_sense_hardw_error));
}
goto out;
- } else if (unlikely(scst_check_sense(cmd)))
+ } else if (unlikely(scst_check_sense(cmd))) {
+ /*
+ * We can't allow atomic command on the exec stages, so
+ * restart to the thread
+ */
+ res = SCST_CMD_STATE_RES_NEED_THREAD;
goto out;
+ }
if (likely(scsi_status_is_good(cmd->status))) {
unsigned char type = cmd->dev->type;
@@ -3295,6 +3301,24 @@
if (unlikely(cmd->internal))
cmd->state = SCST_CMD_STATE_FINISHED_INTERNAL;
+#ifndef CONFIG_SCST_TEST_IO_IN_SIRQ
+ if (cmd->state != SCST_CMD_STATE_PRE_XMIT_RESP) {
+ /* We can't allow atomic command on the exec stages */
+ if (scst_cmd_atomic(cmd)) {
+ switch (state) {
+ case SCST_CMD_STATE_TGT_PRE_EXEC:
+ case SCST_CMD_STATE_SEND_FOR_EXEC:
+ case SCST_CMD_STATE_LOCAL_EXEC:
+ case SCST_CMD_STATE_REAL_EXEC:
+ TRACE_DBG("Atomic context and redirect, "
+ "rescheduling (cmd %p)", cmd);
+ res = SCST_CMD_STATE_RES_NEED_THREAD;
+ break;
+ }
+ }
+ }
+#endif
+
out:
TRACE_EXIT_HRES(res);
return res;
@@ -4057,8 +4081,8 @@
case SCST_CMD_STATE_PRE_DEV_DONE:
res = scst_pre_dev_done(cmd);
- EXTRACHECKS_BUG_ON(res ==
- SCST_CMD_STATE_RES_NEED_THREAD);
+ EXTRACHECKS_BUG_ON((res == SCST_CMD_STATE_RES_NEED_THREAD) &&
+ (cmd->state == SCST_CMD_STATE_PRE_DEV_DONE));
break;
case SCST_CMD_STATE_MODE_SELECT_CHECKS:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2011-05-20 19:09:52
|
Revision: 3466
http://scst.svn.sourceforge.net/scst/?rev=3466&view=rev
Author: vlnb
Date: 2011-05-20 19:09:45 +0000 (Fri, 20 May 2011)
Log Message:
-----------
On NEED_THREAD current function should be immediately finished
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2011-05-20 16:38:57 UTC (rev 3465)
+++ trunk/scst/src/scst_targ.c 2011-05-20 19:09:45 UTC (rev 3466)
@@ -1293,7 +1293,7 @@
"rdy_to_xfer() requested thread "
"context, rescheduling", tgtt->name);
res = SCST_CMD_STATE_RES_NEED_THREAD;
- break;
+ goto out;
default:
goto out_error_rc;
@@ -3332,7 +3332,7 @@
"thread context, rescheduling",
dev->handler->name);
res = SCST_CMD_STATE_RES_NEED_THREAD;
- break;
+ goto out;
#ifdef CONFIG_SCST_EXTRACHECKS
default:
if (state >= 0) {
@@ -3560,7 +3560,7 @@
"requested thread context, rescheduling",
tgtt->name);
res = SCST_CMD_STATE_RES_NEED_THREAD;
- break;
+ goto out;
default:
goto out_error;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2011-06-15 20:16:03
|
Revision: 3578
http://scst.svn.sourceforge.net/scst/?rev=3578&view=rev
Author: vlnb
Date: 2011-06-15 20:15:56 +0000 (Wed, 15 Jun 2011)
Log Message:
-----------
Logging improvements and cleanups
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2011-06-15 20:12:56 UTC (rev 3577)
+++ trunk/scst/src/scst_targ.c 2011-06-15 20:15:56 UTC (rev 3578)
@@ -346,9 +346,9 @@
TRACE_DBG("Preferred context: %d (cmd %p)", pref_context, cmd);
TRACE(TRACE_SCSI, "tag=%llu, lun=%lld, CDB len=%d, queue_type=%x "
- "(cmd %p)", (long long unsigned int)cmd->tag,
+ "(cmd %p, sess %p)", (long long unsigned int)cmd->tag,
(long long unsigned int)cmd->lun, cmd->cdb_len,
- cmd->queue_type, cmd);
+ cmd->queue_type, cmd, sess);
PRINT_BUFF_FLAG(TRACE_SCSI|TRACE_RCV_BOT, "Receiving CDB",
cmd->cdb, cmd->cdb_len);
@@ -5678,10 +5678,10 @@
if (mcmd->fn < SCST_UNREG_SESS_TM)
TRACE(TRACE_MGMT, "TM fn %d finished, "
- "status %x", mcmd->fn, mcmd->status);
+ "status %d", mcmd->fn, mcmd->status);
else
TRACE_MGMT_DBG("TM fn %d finished, "
- "status %x", mcmd->fn, mcmd->status);
+ "status %d", mcmd->fn, mcmd->status);
if (mcmd->fn == SCST_PR_ABORT_ALL) {
mcmd->origin_pr_cmd->scst_cmd_done(mcmd->origin_pr_cmd,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2011-06-30 01:01:23
|
Revision: 3645
http://scst.svn.sourceforge.net/scst/?rev=3645&view=rev
Author: vlnb
Date: 2011-06-30 01:01:17 +0000 (Thu, 30 Jun 2011)
Log Message:
-----------
- scst_check_local_events() should be called in scst_real_exec() and
scst_local_exec(), because if a command passed in those procedures, it
for sure was delayed in some list, so recheck if it was aborted is
necessary.
- Cleanup
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2011-06-29 01:45:42 UTC (rev 3644)
+++ trunk/scst/src/scst_targ.c 2011-06-30 01:01:17 UTC (rev 3645)
@@ -2587,13 +2587,17 @@
static inline int scst_real_exec(struct scst_cmd *cmd)
{
- int res;
+ int res, rc;
TRACE_ENTRY();
BUILD_BUG_ON(SCST_CMD_STATE_RES_CONT_SAME != SCST_EXEC_NOT_COMPLETED);
BUILD_BUG_ON(SCST_CMD_STATE_RES_CONT_NEXT != SCST_EXEC_COMPLETED);
+ rc = scst_check_local_events(cmd);
+ if (unlikely(rc != 0))
+ goto out_done;
+
__scst_cmd_get(cmd);
res = scst_do_real_exec(cmd);
@@ -2611,8 +2615,14 @@
/* SCST_EXEC_* match SCST_CMD_STATE_RES_* */
+out:
TRACE_EXIT_RES(res);
return res;
+
+out_done:
+ cmd->scst_cmd_done(cmd, SCST_CMD_STATE_DEFAULT, SCST_CONTEXT_SAME);
+ res = SCST_CMD_STATE_RES_CONT_NEXT;
+ goto out;
}
static int scst_do_local_exec(struct scst_cmd *cmd)
@@ -2678,13 +2688,17 @@
static int scst_local_exec(struct scst_cmd *cmd)
{
- int res;
+ int res, rc;
TRACE_ENTRY();
BUILD_BUG_ON(SCST_CMD_STATE_RES_CONT_SAME != SCST_EXEC_NOT_COMPLETED);
BUILD_BUG_ON(SCST_CMD_STATE_RES_CONT_NEXT != SCST_EXEC_COMPLETED);
+ rc = scst_check_local_events(cmd);
+ if (unlikely(rc != 0))
+ goto out_done;
+
__scst_cmd_get(cmd);
res = scst_do_local_exec(cmd);
@@ -2698,8 +2712,15 @@
__scst_cmd_put(cmd);
/* SCST_EXEC_* match SCST_CMD_STATE_RES_* */
+
+out:
TRACE_EXIT_RES(res);
return res;
+
+out_done:
+ cmd->scst_cmd_done(cmd, SCST_CMD_STATE_DEFAULT, SCST_CONTEXT_SAME);
+ res = SCST_CMD_STATE_RES_CONT_NEXT;
+ goto out;
}
static int scst_pre_exec_checks(struct scst_cmd *cmd)
@@ -2728,7 +2749,7 @@
{
struct scst_cmd *cmd = *active_cmd;
struct scst_cmd *ref_cmd;
- int count = 0, rc;
+ int count = 0;
TRACE_ENTRY();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bva...@us...> - 2011-07-02 11:55:57
|
Revision: 3651
http://scst.svn.sourceforge.net/scst/?rev=3651&view=rev
Author: bvassche
Date: 2011-07-02 11:55:51 +0000 (Sat, 02 Jul 2011)
Log Message:
-----------
scst: Avoid that the compiler complains about 'dev' being unused with CONFIG_SCST_STRICT_SERIALIZING enabled
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2011-07-02 11:54:14 UTC (rev 3650)
+++ trunk/scst/src/scst_targ.c 2011-07-02 11:55:51 UTC (rev 3651)
@@ -465,7 +465,9 @@
int scst_pre_parse(struct scst_cmd *cmd)
{
int res;
+#ifndef CONFIG_SCST_STRICT_SERIALIZING
struct scst_device *dev = cmd->dev;
+#endif
struct scst_dev_type *devt = cmd->devt;
int rc;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2011-11-23 02:14:44
|
Revision: 3935
http://scst.svn.sourceforge.net/scst/?rev=3935&view=rev
Author: vlnb
Date: 2011-11-23 02:14:38 +0000 (Wed, 23 Nov 2011)
Log Message:
-----------
Report target name when session assigned to security group
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2011-11-18 20:32:01 UTC (rev 3934)
+++ trunk/scst/src/scst_targ.c 2011-11-23 02:14:38 UTC (rev 3935)
@@ -6240,8 +6240,9 @@
sess->acg = scst_find_acg(sess);
- PRINT_INFO("Using security group \"%s\" for initiator \"%s\"",
- sess->acg->acg_name, sess->initiator_name);
+ PRINT_INFO("Using security group \"%s\" for initiator \"%s\" "
+ "(target %s)", sess->acg->acg_name, sess->initiator_name,
+ sess->tgt->tgt_name);
list_add_tail(&sess->acg_sess_list_entry, &sess->acg->acg_sess_list);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2011-12-01 03:31:38
|
Revision: 3942
http://scst.svn.sourceforge.net/scst/?rev=3942&view=rev
Author: vlnb
Date: 2011-12-01 03:31:30 +0000 (Thu, 01 Dec 2011)
Log Message:
-----------
In the function scst_mgmt_translate_lun() the variable tgt_dev is
used as a loop variable and is used inside that loop only.
Hence it is not necessary to initialize it to NULL.
BSD-Signed-off-by: Bart Van Assche <bva...@ac...>
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2011-12-01 03:28:39 UTC (rev 3941)
+++ trunk/scst/src/scst_targ.c 2011-12-01 03:31:30 UTC (rev 3942)
@@ -4374,7 +4374,7 @@
*/
static int scst_mgmt_translate_lun(struct scst_mgmt_cmd *mcmd)
{
- struct scst_tgt_dev *tgt_dev = NULL;
+ struct scst_tgt_dev *tgt_dev;
struct list_head *head;
int res = -1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2011-12-19 21:30:25
|
Revision: 4017
http://scst.svn.sourceforge.net/scst/?rev=4017&view=rev
Author: vlnb
Date: 2011-12-19 21:30:18 +0000 (Mon, 19 Dec 2011)
Log Message:
-----------
Improve release mode TM logging to simplify imvestigations
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2011-12-19 19:40:31 UTC (rev 4016)
+++ trunk/scst/src/scst_targ.c 2011-12-19 21:30:18 UTC (rev 4017)
@@ -4749,11 +4749,12 @@
}
if (mstb->done_counted || mstb->finish_counted) {
- TRACE_MGMT_DBG("cmd %p (tag %llu, sn %u) being "
- "executed/xmitted (state %d, op %x, proc time "
- "%ld sec., timeout %d sec.), deferring ABORT "
- "(cmd_done_wait_count %d, cmd_finish_wait_count "
- "%d)", cmd, (long long unsigned int)cmd->tag,
+ TRACE(TRACE_SCSI|TRACE_MGMT_DEBUG, "cmd %p (tag %llu, "
+ "sn %u) being executed/xmitted (state %d, "
+ "op %x, proc time %ld sec., timeout %d sec.), "
+ "deferring ABORT (cmd_done_wait_count %d, "
+ "cmd_finish_wait_count %d)", cmd,
+ (long long unsigned int)cmd->tag,
cmd->sn, cmd->state, cmd->cdb[0],
(long)(jiffies - cmd->start_time) / HZ,
cmd->timeout / HZ, mcmd->cmd_done_wait_count,
@@ -4796,7 +4797,8 @@
mcmd->state = SCST_MCMD_STATE_AFFECTED_CMDS_DONE;
res = 0;
} else {
- TRACE_MGMT_DBG("cmd_done_wait_count(%d) not 0, "
+ TRACE(TRACE_SCSI|TRACE_MGMT_DEBUG,
+ "cmd_done_wait_count(%d) not 0, "
"preparing to wait", mcmd->cmd_done_wait_count);
mcmd->state = SCST_MCMD_STATE_WAITING_AFFECTED_CMDS_DONE;
res = -1;
@@ -4808,7 +4810,8 @@
mcmd->state = SCST_MCMD_STATE_DONE;
res = 0;
} else {
- TRACE_MGMT_DBG("cmd_finish_wait_count(%d) not 0, "
+ TRACE(TRACE_SCSI|TRACE_MGMT_DEBUG,
+ "cmd_finish_wait_count(%d) not 0, "
"preparing to wait",
mcmd->cmd_finish_wait_count);
mcmd->state = SCST_MCMD_STATE_WAITING_AFFECTED_CMDS_FINISHED;
@@ -5649,11 +5652,11 @@
mcmd->status = SCST_MGMT_STATUS_TASK_NOT_EXIST;
if (mcmd->fn < SCST_UNREG_SESS_TM)
- TRACE(TRACE_MGMT, "TM fn %d finished, "
- "status %d", mcmd->fn, mcmd->status);
+ TRACE(TRACE_MGMT, "TM fn %d (%p) finished, "
+ "status %d", mcmd->fn, mcmd, mcmd->status);
else
- TRACE_MGMT_DBG("TM fn %d finished, "
- "status %d", mcmd->fn, mcmd->status);
+ TRACE_MGMT_DBG("TM fn %d (%p) finished, "
+ "status %d", mcmd->fn, mcmd, mcmd->status);
if (mcmd->fn == SCST_PR_ABORT_ALL) {
mcmd->origin_pr_cmd->scst_cmd_done(mcmd->origin_pr_cmd,
@@ -5977,9 +5980,9 @@
mcmd->cmd_sn = params->cmd_sn;
if (params->fn < SCST_UNREG_SESS_TM)
- TRACE(TRACE_MGMT, "TM fn %d", params->fn);
+ TRACE(TRACE_MGMT, "TM fn %d (%p)", params->fn, mcmd);
else
- TRACE_MGMT_DBG("TM fn %d", params->fn);
+ TRACE_MGMT_DBG("TM fn %d (%p)", params->fn, mcmd);
TRACE_MGMT_DBG("sess=%p, tag_set %d, tag %lld, lun_set %d, "
"lun=%lld, cmd_sn_set %d, cmd_sn %d, priv %p", sess,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2012-03-27 01:59:19
|
Revision: 4175
http://scst.svn.sourceforge.net/scst/?rev=4175&view=rev
Author: vlnb
Date: 2012-03-27 01:59:13 +0000 (Tue, 27 Mar 2012)
Log Message:
-----------
scst: Add a clarification about how conflicting commands are processed
Signed-off-by: Bart Van Assche <bva...@ac...>
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2012-03-27 01:50:30 UTC (rev 4174)
+++ trunk/scst/src/scst_targ.c 2012-03-27 01:59:13 UTC (rev 4175)
@@ -3693,9 +3693,25 @@
return res;
}
-/*
+/**
+ * scst_cmd_set_sn - Assign a slot number to a command.
+ *
+ * Commands that may be executed concurrently are assigned the same slot
+ * number. A command that must be executed after previously received commands
+ * is assigned a new and higher slot number.
+ *
* No locks, but it must be externally serialized (see comment for
* scst_cmd_init_done() in scst.h)
+ *
+ * Note: This approach in full compliance with SAM may result in the reordering
+ * of conflicting SIMPLE READ and/or WRITE commands (commands with at least
+ * partially overlapping data ranges and of which at least one of them is a
+ * WRITE command). An initiator is not allowed to submit such conflicting
+ * commands. After having modified data, an initiator must wait for the result
+ * of that operation before rereading or rewriting the modified data range or
+ * use ORDERED subsequent conflicting command(s). See also comments about the
+ * command identifier in SAM-5 or comments about task tags and command
+ * reordering in previous SAM revisions.
*/
static void scst_cmd_set_sn(struct scst_cmd *cmd)
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2012-04-30 19:31:19
|
Revision: 4252
http://scst.svn.sourceforge.net/scst/?rev=4252&view=rev
Author: vlnb
Date: 2012-04-30 19:31:13 +0000 (Mon, 30 Apr 2012)
Log Message:
-----------
scst_check_auto_sense(): Change return typefrom int to bool
Signed-off-by: Bart Van Assche <bva...@ac...>
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2012-04-30 19:29:47 UTC (rev 4251)
+++ trunk/scst/src/scst_targ.c 2012-04-30 19:31:13 UTC (rev 4252)
@@ -2996,9 +2996,9 @@
return res;
}
-static int scst_check_auto_sense(struct scst_cmd *cmd)
+static bool scst_check_auto_sense(struct scst_cmd *cmd)
{
- int res = 0;
+ bool res = false;
TRACE_ENTRY();
@@ -3010,7 +3010,7 @@
"cmd->host_status=%x, cmd->driver_status=%x (cmd %p)",
cmd->status, cmd->msg_status, cmd->host_status,
cmd->driver_status, cmd);
- res = 1;
+ res = true;
} else if (unlikely(cmd->host_status)) {
if ((cmd->host_status == DID_REQUEUE) ||
(cmd->host_status == DID_IMM_RETRY) ||
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2012-06-28 23:31:13
|
Revision: 4389
http://scst.svn.sourceforge.net/scst/?rev=4389&view=rev
Author: vlnb
Date: 2012-06-28 23:31:07 +0000 (Thu, 28 Jun 2012)
Log Message:
-----------
scst: Remove a superfluous goto statement and a superfluous label
Signed-off-by: Bart Van Assche <bva...@ac...>
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2012-06-28 22:43:19 UTC (rev 4388)
+++ trunk/scst/src/scst_targ.c 2012-06-28 23:31:07 UTC (rev 4389)
@@ -2631,9 +2631,7 @@
out_error:
scst_set_cmd_error(cmd, SCST_LOAD_SENSE(scst_sense_hardw_error));
- goto out_done;
-out_done:
res = SCST_EXEC_COMPLETED;
/* Report the result */
cmd->scst_cmd_done(cmd, SCST_CMD_STATE_DEFAULT, SCST_CONTEXT_SAME);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2012-07-23 19:39:39
|
Revision: 4417
http://scst.svn.sourceforge.net/scst/?rev=4417&view=rev
Author: vlnb
Date: 2012-07-23 19:39:33 +0000 (Mon, 23 Jul 2012)
Log Message:
-----------
Skip waiting for internal commands after abort.
Waiting for their parent commands is required and sufficient.
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2012-07-21 03:28:57 UTC (rev 4416)
+++ trunk/scst/src/scst_targ.c 2012-07-23 19:39:33 UTC (rev 4417)
@@ -4817,6 +4817,9 @@
*/
smp_mb__after_set_bit();
+ if (cmd->internal)
+ goto out;
+
if (cmd->tgt_dev == NULL) {
spin_lock_irqsave(&scst_init_lock, flags);
scst_init_poll_cnt++;
@@ -4901,6 +4904,7 @@
unlock:
spin_unlock_irqrestore(&scst_mcmd_lock, flags);
+out:
tm_dbg_release_cmd(cmd);
TRACE_EXIT();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2012-07-25 18:48:12
|
Revision: 4423
http://scst.svn.sourceforge.net/scst/?rev=4423&view=rev
Author: vlnb
Date: 2012-07-25 18:48:06 +0000 (Wed, 25 Jul 2012)
Log Message:
-----------
scst_sess_get() should be done in scst_pre_rx_mgmt_cmd() instead of scst_post_rx_mgmt_cmd()
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2012-07-24 19:35:04 UTC (rev 4422)
+++ trunk/scst/src/scst_targ.c 2012-07-25 18:48:06 UTC (rev 4423)
@@ -222,6 +222,8 @@
goto out;
cmd->sess = sess;
+ scst_sess_get(sess);
+
cmd->tgt = sess->tgt;
cmd->tgtt = sess->tgt->tgtt;
@@ -231,7 +233,6 @@
SCST_LOAD_SENSE(scst_sense_lun_not_supported));
TRACE_DBG("cmd %p, sess %p", cmd, sess);
- scst_sess_get(sess);
out:
TRACE_EXIT();
@@ -6036,6 +6037,10 @@
}
mcmd->sess = sess;
+ scst_sess_get(sess);
+
+ atomic_inc(&sess->sess_cmd_count);
+
mcmd->fn = fn;
mcmd->state = SCST_MCMD_STATE_INIT;
mcmd->tgt_priv = tgt_priv;
@@ -6058,8 +6063,6 @@
TRACE_ENTRY();
- scst_sess_get(sess);
-
if (unlikely(sess->shut_phase != SCST_SESS_SPH_READY)) {
PRINT_CRIT_ERROR("New mgmt cmd while shutting down the "
"session %p shut_phase %ld", sess, sess->shut_phase);
@@ -6069,7 +6072,6 @@
local_irq_save(flags);
spin_lock(&sess->sess_list_lock);
- atomic_inc(&sess->sess_cmd_count);
if (unlikely(sess->init_phase != SCST_SESS_IPH_READY)) {
switch (sess->init_phase) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <bva...@us...> - 2012-08-08 07:02:42
|
Revision: 4455
http://scst.svn.sourceforge.net/scst/?rev=4455&view=rev
Author: bvassche
Date: 2012-08-08 07:02:36 +0000 (Wed, 08 Aug 2012)
Log Message:
-----------
scst: Fix a recently introduced checkpatch complaint
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2012-08-07 18:06:37 UTC (rev 4454)
+++ trunk/scst/src/scst_targ.c 2012-08-08 07:02:36 UTC (rev 4455)
@@ -6413,7 +6413,7 @@
EXPORT_SYMBOL_GPL(scst_initiator_has_luns);
static char *scst_get_unique_sess_name(struct list_head *sess_list,
- const char* initiator_name)
+ const char *initiator_name)
{
char *name = (char *)initiator_name;
struct scst_session *s;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2012-08-11 01:37:15
|
Revision: 4465
http://scst.svn.sourceforge.net/scst/?rev=4465&view=rev
Author: vlnb
Date: 2012-08-11 01:37:07 +0000 (Sat, 11 Aug 2012)
Log Message:
-----------
Microoptimization
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2012-08-10 02:02:35 UTC (rev 4464)
+++ trunk/scst/src/scst_targ.c 2012-08-11 01:37:07 UTC (rev 4465)
@@ -4008,14 +4008,15 @@
scst_pre_parse(cmd);
if (!cmd->set_sn_on_restart_cmd) {
- if (cmd->tgtt->multithreaded_init_done) {
+ if (!cmd->tgtt->multithreaded_init_done)
+ scst_cmd_set_sn(cmd);
+ else {
struct scst_order_data *order_data = cmd->cur_order_data;
unsigned long flags;
spin_lock_irqsave(&order_data->init_done_lock, flags);
scst_cmd_set_sn(cmd);
spin_unlock_irqrestore(&order_data->init_done_lock, flags);
- } else
- scst_cmd_set_sn(cmd);
+ }
}
} else if (res < 0) {
TRACE_DBG("Finishing cmd %p", cmd);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <vl...@us...> - 2012-09-28 21:09:55
|
Revision: 4533
http://scst.svn.sourceforge.net/scst/?rev=4533&view=rev
Author: vlnb
Date: 2012-09-28 21:09:49 +0000 (Fri, 28 Sep 2012)
Log Message:
-----------
Oops, the previous commit was incomplete
Modified Paths:
--------------
trunk/scst/src/scst_targ.c
Modified: trunk/scst/src/scst_targ.c
===================================================================
--- trunk/scst/src/scst_targ.c 2012-09-28 21:04:56 UTC (rev 4532)
+++ trunk/scst/src/scst_targ.c 2012-09-28 21:09:49 UTC (rev 4533)
@@ -1560,6 +1560,8 @@
*/
scst_set_cmd_error(cmd,
SCST_LOAD_SENSE(scst_sense_invalid_field_in_command_information_unit));
+ scst_set_cmd_abnormal_done_state(cmd);
+ goto out;
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|