Fix for possible requirsive target_mutex taking

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1554 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2010-03-17 19:41:16 +00:00
parent cbaab260f1
commit 2fcee2a380

View File

@@ -350,11 +350,11 @@ void target_del_all(void)
list_for_each_entry_safe(target, t, &target_list,
target_list_entry) {
mutex_lock(&target->target_mutex);
if (!list_empty(&target->session_list)) {
target_del_all_sess(target,
ISCSI_CONN_ACTIVE_CLOSE |
ISCSI_CONN_DELETING);
mutex_unlock(&target->target_mutex);
} else if (!first) {
TRACE_MGMT_DBG("Deleting target %p", target);
list_del(&target->target_list_entry);
@@ -363,6 +363,8 @@ void target_del_all(void)
target_destroy(target);
continue;
}
mutex_unlock(&target->target_mutex);
}
mutex_unlock(&target_mgmt_mutex);
msleep(100);