mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-20 04:01:26 +00:00
Merge of the trunk's r2867:
Fix rarely possible race between scst_free_session() and scst_check_reassign_sess() git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.0.0.x@2868 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1719,6 +1719,9 @@ static void scst_check_reassign_sess(struct scst_session *sess)
|
||||
|
||||
TRACE_ENTRY();
|
||||
|
||||
if (tgt_dev->sess->shut_phase != SCST_SESS_SPH_READY)
|
||||
goto out;
|
||||
|
||||
TRACE_MGMT_DBG("Checking reassignment for sess %p (initiator %s)",
|
||||
sess, sess->initiator_name);
|
||||
|
||||
|
||||
@@ -6254,6 +6254,10 @@ static int scst_init_session(struct scst_session *sess)
|
||||
if (res != 0)
|
||||
goto failed;
|
||||
|
||||
/*
|
||||
* scst_sess_alloc_tgt_devs() must be called after session added in the
|
||||
* sess_list to not race with scst_check_reassign_sess()!
|
||||
*/
|
||||
res = scst_sess_alloc_tgt_devs(sess);
|
||||
|
||||
failed:
|
||||
|
||||
Reference in New Issue
Block a user