mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-21 14:46:23 +00:00
Increment session refcount in scst_pre_rx_mgmt_cmd() instead of scst_post_rx_mgmt_cmd() (merge r4423 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4626 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
+1
-1
@@ -1768,7 +1768,7 @@ size_t qla2xxx_del_vtarget(u64 *port_name)
|
||||
/* We only allow support on Channel 0 !!! */
|
||||
list_for_each_entry(vport, &fc_host->vports, peers) {
|
||||
if ((vport->channel == 0) &&
|
||||
(vport->port_name == *port_name)) {
|
||||
(vport->port_name == *port_name)) {
|
||||
match = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -209,6 +209,8 @@ struct scst_cmd *scst_rx_cmd(struct scst_session *sess,
|
||||
goto out;
|
||||
|
||||
cmd->sess = sess;
|
||||
scst_sess_get(sess);
|
||||
|
||||
cmd->tgt = sess->tgt;
|
||||
cmd->tgtt = sess->tgt->tgtt;
|
||||
|
||||
@@ -218,7 +220,6 @@ struct scst_cmd *scst_rx_cmd(struct scst_session *sess,
|
||||
SCST_LOAD_SENSE(scst_sense_lun_not_supported));
|
||||
|
||||
TRACE_DBG("cmd %p, sess %p", cmd, sess);
|
||||
scst_sess_get(sess);
|
||||
|
||||
out:
|
||||
TRACE_EXIT();
|
||||
@@ -5947,6 +5948,10 @@ static struct scst_mgmt_cmd *scst_pre_rx_mgmt_cmd(struct scst_session
|
||||
}
|
||||
|
||||
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;
|
||||
@@ -5969,8 +5974,6 @@ static int scst_post_rx_mgmt_cmd(struct scst_session *sess,
|
||||
|
||||
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);
|
||||
@@ -5980,7 +5983,6 @@ static int scst_post_rx_mgmt_cmd(struct scst_session *sess,
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user