mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
Fix small possible race in sessions management
In q2t_del_sess_work_fn() session can get ready to be destroyed before hardware_lock is taken From Bart Van Assche <bvanassche@acm.org> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5020 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1136,6 +1136,7 @@ static void q2t_undelete_sess(struct q2t_sess *sess)
|
||||
TRACE_ENTRY();
|
||||
|
||||
sBUG_ON(!sess->deleted);
|
||||
sBUG_ON(!list_entry_in_list(&sess->sess_list_entry));
|
||||
|
||||
TRACE_MGMT_DBG("Undeleting sess %p", sess);
|
||||
list_move(&sess->sess_list_entry, &sess->tgt->sess_list);
|
||||
@@ -1175,8 +1176,12 @@ static void q2t_del_sess_work_fn(struct delayed_work *work)
|
||||
cancel = q2t_check_fcport_exist(ha, sess);
|
||||
spin_lock_irqsave(&pha->hardware_lock, flags);
|
||||
|
||||
if (!sess->deleted) {
|
||||
/* sess was undeleted while we were thinking */
|
||||
if (!sess->deleted ||
|
||||
!list_entry_in_list(&sess->sess_list_entry)) {
|
||||
/*
|
||||
* session has been undeleted or got ready to
|
||||
* be destroyed while we were entering here
|
||||
*/
|
||||
goto put_continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user