From 62cc7779058b12433f169c9e0e1eff33b55c7f9c Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Tue, 27 Mar 2012 01:43:28 +0000 Subject: [PATCH] scst: Don't specify a LUN when issuingSCST_UNREG_SESS_TM The LUN argument is ignored while processing SCST_UNREG_SESS_TM, so don't pass LUN information when issuing that task management function. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4170 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/include/scst.h | 2 +- scst/src/scst_targ.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scst/include/scst.h b/scst/include/scst.h index 74535c3f1..02845258c 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -2888,7 +2888,7 @@ static inline int scst_rx_mgmt_fn_lun(struct scst_session *sess, int fn, params.fn = fn; params.lun = lun; params.lun_len = lun_len; - params.lun_set = 1; + params.lun_set = !!lun; params.atomic = atomic; params.tgt_priv = tgt_priv; return scst_rx_mgmt_fn(sess, ¶ms); diff --git a/scst/src/scst_targ.c b/scst/src/scst_targ.c index 8b05351dd..fde7e9c31 100644 --- a/scst/src/scst_targ.c +++ b/scst/src/scst_targ.c @@ -5953,6 +5953,7 @@ int scst_rx_mgmt_fn(struct scst_session *sess, case SCST_TARGET_RESET: case SCST_ABORT_ALL_TASKS: case SCST_NEXUS_LOSS: + case SCST_UNREG_SESS_TM: break; default: sBUG_ON(!params->lun_set); @@ -6472,7 +6473,7 @@ void scst_unregister_session(struct scst_session *sess, int wait, { unsigned long flags; DECLARE_COMPLETION_ONSTACK(c); - int rc, lun; + int rc; TRACE_ENTRY(); @@ -6481,9 +6482,8 @@ void scst_unregister_session(struct scst_session *sess, int wait, sess->unreg_done_fn = unreg_done_fn; /* Abort all outstanding commands and clear reservation, if necessary */ - lun = 0; rc = scst_rx_mgmt_fn_lun(sess, SCST_UNREG_SESS_TM, - &lun, sizeof(lun), SCST_ATOMIC, NULL); + NULL, 0, SCST_ATOMIC, NULL); if (rc != 0) { PRINT_ERROR("SCST_UNREG_SESS_TM failed %d (sess %p)", rc, sess);