|
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.
|