mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-22 05:01:27 +00:00
qla2x00t: Fix q2t_close_session()
The "force_close" sysfs attribute remains to exist for some time after q2t_close_session() finished. Avoid that q2t_close_session() invokes q2t_sess_put() more than once by removing a session from the session list before returning. Avoid that that disabling a target after q2t_close_session() has been invoked triggers a call of q2t_sess_put(). Avoid that triggering the "force_close" sysfs attribute after a target has been disabled triggers an additional call of q2t_sess_put(). git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4944 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -670,7 +670,7 @@ static int q2t_unreg_sess(struct q2t_sess *sess)
|
||||
sBUG_ON(sess->sess_ref != 0);
|
||||
|
||||
TRACE_MGMT_DBG("Deleting sess %p from tgt %p", sess, sess->tgt);
|
||||
list_del(&sess->sess_list_entry);
|
||||
list_del_init(&sess->sess_list_entry);
|
||||
|
||||
if (sess->deleted)
|
||||
list_del(&sess->del_list_entry);
|
||||
@@ -806,7 +806,10 @@ static int q2t_close_session(struct scst_session *scst_sess)
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&pha->hardware_lock, flags);
|
||||
q2t_schedule_sess_for_deletion(sess);
|
||||
if (!list_empty(&sess->sess_list_entry)) {
|
||||
list_del_init(&sess->sess_list_entry);
|
||||
q2t_sess_put(sess);
|
||||
}
|
||||
spin_unlock_irqrestore(&pha->hardware_lock, flags);
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user