- Fixed a race, which could lead to BUG() in scst_mgmt_thread()
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Tue, 5 Dec 2006 10:22:53 +0000 (10:22 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Tue, 5 Dec 2006 10:22:53 +0000 (10:22 +0000)
 - Credits updated

git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@44 d57e44dd-8a1f-0410-8b47-8ef2f437770f

scst/README
scst/src/scst_targ.c

index 86e7cae..ecf50ef 100644 (file)
@@ -486,4 +486,6 @@ Thanks to:
  * Calvin Morrow <calvin.morrow@comcast.net> for testing and usful
    suggestions.
 
+ * Erik Habbinga <erikhabbinga@inphase-tech.com> for fixes.
+
 Vladislav Bolkhovitin <vst@vlnb.net>, http://scst.sourceforge.net
index 6cdbff8..0e5c416 100644 (file)
@@ -3861,11 +3861,13 @@ restart:
                list_for_each_entry(sess, &scst_sess_mgmt_list,
                        sess_mgmt_list_entry)
                {
+                       int shutting_down;
                        TRACE_DBG("Removing sess %p from scst_sess_mgmt_list",
                                sess);
                        list_del(&sess->sess_mgmt_list_entry);
+                       shutting_down = sess->shutting_down;
                        spin_unlock_irq(&scst_mgmt_lock);
-                       if (sess->shutting_down) {
+                       if (shutting_down) {
                                BUG_ON(atomic_read(&sess->refcnt) != 0);
                                scst_free_session_callback(sess);
                        } else if (sess->init_phase == SCST_SESS_IPH_INITING) {