diff options
author | Eddie Wai <eddie.wai@broadcom.com> | 2010-10-25 17:52:40 -0700 |
---|---|---|
committer | Mike Christie <michaelc@cs.wisc.edu> | 2010-10-27 17:34:34 -0500 |
commit | e362dd2f1ddbb718f06489d0017cf2250079908a (patch) | |
tree | 31efcf7fcacc8a07df0ae73cee66e3704746987c /utils | |
parent | f11b391bded377708c8e2c5c52ed626d3f2a1fa9 (diff) | |
download | open-iscsi-e362dd2f1ddbb718f06489d0017cf2250079908a.tar.gz |
ISCSID: Fixed a race condition in the INVALID_HOST path
The race condition can be observed with the following sequence of events:
- For every active sessions, issue an ISCSI_ERR_CONN_FAILED nl msg
(This will eventually put all active connections into the actor_list ready
to execute the session_conn_reopen procedure)
- Asynchronously after a few seconds, call the iscsi_host_remove procedure
(This will notify iscsid with the ISCSI_ERR_INVALID_HOST nl message)
The current code actually handles this by advancing the INVALID_HOST
session_conn_error actor scheduing to the head via the actor_schedule_head
procedure. However, if the current actor thread was call-backed from the
actor_poll loop, then this head scheduling will actually put the INVALID_HOST
actor onto the poll_list instead of the actor_list.
If there are subsequent elements in the actor_list which triggers the reopen
path, then the conn_context for the INVALID_HOST for that particular
connection will get flushed (+ actor_delete). This will then lockup the
libiscsi's iscsi_host_remove call as it will wait indefinitely on all
sessions to be removed.
The fix is to put this head scheduling to the head of the actor_list
regardless of poll mode or not. This will allow all INVALID_PATH actors
to have a chance to get executed before any subsequent reopen actors.
Signed-off-by: Eddie Wai <eddie.wai@broadcom.com>
Diffstat (limited to 'utils')
0 files changed, 0 insertions, 0 deletions