From: David B. <dab...@gm...> - 2017-03-22 07:19:23
|
--- scst-svn-7105-trunk.ORIG/iscsi-scst/kernel/conn.c 2016-12-19 22:53:48.000000000 -0700 +++ scst/iscsi-scst/kernel/conn.c 2017-03-18 10:57:32.485216807 -0600 @@ -397,7 +397,7 @@ */ list_for_each_entry_reverse(conn, &session->conn_list, conn_list_entry) { - if (conn->cid == cid) + if (conn->cid == cid && !conn->closing) //XXXX Right? return conn; } return NULL; This 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 above 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. [This should be reviewed by someone more familiar with the code.] |