diff options
author | Chris Leech <cleech@redhat.com> | 2015-02-12 16:38:00 -0800 |
---|---|---|
committer | Mike Christie <michaelc@cs.wisc.edu> | 2015-03-02 00:48:24 -0600 |
commit | 006270c0f9a1fa1e78574a7eaa04bb9ae1ef62b6 (patch) | |
tree | 4e9316372aacae54904a52d96ae02ae59c09417c /usr/initiator.c | |
parent | 63d086c9cb84b881e13ce8a5b4ddb80234948258 (diff) | |
download | open-iscsi-006270c0f9a1fa1e78574a7eaa04bb9ae1ef62b6.tar.gz |
iscsid: don't re-read config file for every session logout
Follow up to the safe_logout feature patch.
Cache the safe_logout setting when iscsid is started.
Signed-off-by: Chris Leech <cleech@redhat.com>
Diffstat (limited to 'usr/initiator.c')
-rw-r--r-- | usr/initiator.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/usr/initiator.c b/usr/initiator.c index 2f17882..b25ded8 100644 --- a/usr/initiator.c +++ b/usr/initiator.c @@ -2333,7 +2333,6 @@ int session_logout_task(int sid, queue_task_t *qtask) iscsi_session_t *session; iscsi_conn_t *conn; int rc = ISCSI_SUCCESS; - char *safe; session = session_find_by_sid(sid); if (!session) { @@ -2356,14 +2355,11 @@ invalid_state: return ISCSI_ERR_INTERNAL; } - safe = cfg_get_string_param(dconfig->config_file, "iscsid.safe_logout"); - if (safe && !strcmp(safe, "Yes") && session_in_use(sid)) { + if (dconfig->safe_logout && session_in_use(sid)) { log_error("Session is actively in use for mounted storage, " "and iscsid.safe_logout is configured.\n"); - free(safe); return ISCSI_ERR_BUSY; } - free(safe); /* FIXME: logout all active connections */ conn = &session->conn[0]; |