mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-19 21:56:31 +00:00
iscsi_scst: conn_lookup() skips any conn already closing
This change helped a secondary problem I had under valgrind (due to some other bug) with initiators timing out and reconnecting their sessions faster than the threads were getting cleaned up (for one thing, valgrind only ever runs one thread at a time). It seems logical that the code in conn_lookup() would want to skip any connection that's already known closing in this case, for the same reason it searches the list in reverse. And the dropping connections don't have to drop in order, so searching in reverse doesn't seem sufficient to avoid finding a wrong (stale, closing) connection structure. Signed-off-by: David Butterfield <dab21774@gmail.com> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7144 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -397,7 +397,7 @@ struct iscsi_conn *conn_lookup(struct iscsi_session *session, u16 cid)
|
||||
*/
|
||||
list_for_each_entry_reverse(conn, &session->conn_list,
|
||||
conn_list_entry) {
|
||||
if (conn->cid == cid)
|
||||
if (conn->cid == cid && !conn->closing)
|
||||
return conn;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
Reference in New Issue
Block a user