| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
Try to detect if the kernel exports the necessary info to check if the
session is up and has not fired a conn error while iscsid has been down.
If the session is ok, then don't relogin during session sync up.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
|
|
|
|
|
|
|
| |
Add some helpers to get the conn state and test if the connection has sent
a conn error and needs to be cleaned up.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
|
|
|
|
|
|
|
|
| |
If we are doing root over iscsi and iscsid is doing its initial start
up, then we want to read in the config data for all sessions we want
to sync then send iscsid the sync requests which can drop the session.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
|
|
|
|
|
|
|
|
| |
We don't need to wait for the relogin to complete when sending the sync
response. The caller does not know if the sync did a relogin and does not
even check if it did or not. This has us return immediately.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
|
|
|
|
|
|
|
|
|
| |
We only have qtasks for login/sync or logout. There is no need to pass
it around when we can just have 2 pointers for the 2 types. We can then
quickly check if a login or logout is in progress and in the future
kill a running login when we get a logout request.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
|
|\
| |
| | |
Make session and connect log helpful to locate problem
|
| |
| |
| |
| |
| |
| |
| | |
print session and connection id when write qtask response failed
if these ids are accessible
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There are many logs like following which are not helpful to
locate problem when there are multiple sessions:
"unsupported opcode 0xxxx"
We can not know which connection the log belongs to, so this commit
find these logs in initiator.c and add session id, connection id
for them.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
| |
| |
| |
| |
| |
| |
| | |
conn_info() conn_warn() conn_error() and conn_debug() are added.
conn_xxx() macros would print session id and connection id in log.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
|\ \
| | |
| | | |
Fix minor error string typos (editor: and grammar)
|
|/ / |
|
|\ \
| | |
| | | |
Remove HEREIS usage from iscsi-gen-initiatorname
|
|/ /
| |
| |
| |
| |
| |
| | |
This script can be called early in the boot process,
when /tmp is not writable (but /etc/iscsi is), so
change the usage of HEREIS to simple variables.
Otherwise, no change in functionality.
|
|/ |
|
|\
| |
| | |
actor: introduce thread name which would be printed to log.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
iscsid would print log like following if debug level is larger than 3:
iscsid: set operational parameter 35 to:
iscsid: 30
iscsid: set operational parameter 30 to:
iscsid: 5
which is not friendly to read, this commit makes it easy to read,
like this:
iscsid: set operational parameter 35 to: 30
iscsid: set operational parameter 30 to: 5
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
| |
| |
| |
| |
| |
| | |
This is only a enhance, do not change origin logic
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
| |
| |
| |
| |
| |
| |
| | |
This commit is append of 3cf5539 which just print the
thread name in log.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previous actor log makes it hard to figure out what
is going on in the thread, such as:
"deleting a scheduled/waiting thread!"
We only know a thread is deleted, while no other info
like what this thread is about to do and which thread
it is. Logs like following seems better:
"deleting a scheduled/waiting thread 01111e48: session_conn_error !"
It tells thread with id 01111e48, which is going to executed
function "session_conn_error" is deleted.
The commit tries to give name to each thread, the name
is going to be printed with previous messages to make
the log easy to read.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
|\ \
| |/
|/| |
Fix multiple sync of a same session id
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If session id has already been synced just return ISCSI_ERR_SESS_EXISTS.
A same session id would make two MGMT_IPC_SESSION_SYNC requests in
following scenario:
iscsid.socket is enabled, and iscsid did not handle previous
MGMT_IPC_SESSION_SYNC due to abnormal exit. This MGMT_IPC_SESSION_SYNC
request would left unhandled, when iscsid restart again, newly started
iscsid can get this MGMT_IPC_SESSION_SYNC request.
While the newly started iscsid would make a MGMT_IPC_SESSION_SYNC
request for same session id too.
So here should check if the session id has already been synced.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
|\
| |
| | |
Fix wrong install_systemd destination path
|
|/
|
|
|
|
|
|
|
| |
Previous implement would installl systemd files to
"/usr/lib/systemd/system/system" which should be
"/usr/lib/systemd/system". Fix this by updating
variable systemddir.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
|\
| |
| | |
Fix issues discovered by gcc12
|
| |
| |
| |
| |
| |
| | |
Gcc-12 caught a few more errors in the code, where we are
still checking an array address for NULL, which will never
happen.
|
|/
|
|
|
| |
Gcc-12 caught a few errors in the code where we were checking
for an array being empty incorrectly, so this commit fixes those.
|
|\
| |
| | |
iscsi_err: Add iscsid request timed out error messages
|
|/
|
|
|
|
|
|
|
| |
Commit 67eb8b2 added error code ISCSI_ERR_REQ_TIMEOUT.
While did not update array iscsi_error_list which referenced
in iscsi_err_to_str(). Which would access a invalid memory with
when variable of iscsi_err_to_str() is ISCSI_ERR_REQ_TIMEOUT.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
|\
| |
| | |
Improve 'iscsid.conf'
|
| | |
|
|\ \
| | |
| | | |
iscsistart fix and timeout cleanup
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
ISCSI_ERR_SESSION_NOT_CONNECTED does not make sense to return when a
request times out if the request is not for login. This adds a new
error code.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If the caller passes in -1 for the timeout then we can just pass that
to poll instead of waking up and retrying the poll over and over.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We should set the timeout to -1 for the login request becuase if we've
connected to our event loop then the login will either complete, fail
and hit the login retries limit in the initiator, or we will crash and
we will exit. Either way we are going to return evetually, and the
user can configure the retries so they can also limit the time they
will wait.
If we've sent a login request to our event loop we also don't want to
send another one because the initiator will see it on its session loop
and just return immediately.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
|
|\ \ \
| |/ /
|/| | |
libopeniscsiusr: extend sysfs ignore_error to include EINVAL
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The kernel change
"e746f3451ec7 scsi: iscsi: Fix iface sysfs attr detection"
fixed an apparently very-long-standing issue blocking iface attribute
visibility in sysfs.
With that fixed, and networking configuration for the iface now being
readable from sysfs, iscsiadm is showing errors when be2iscsi (and
probably qla4xxx from looking at the code) expose VLAN attributes but
don't have a VLAN configured. Both drivers then return EINVAL on a read
to vlan_id or vlan_priority.
iSCSI ERROR: Error when reading '/sys/class/iscsi_iface/ipv4-iface-17-0/vlan_id': 22 # sysfs.c:iscsi_sysfs_prop_get_ll():282
iSCSI ERROR: Error when reading '/sys/class/iscsi_iface/ipv4-iface-17-0/vlan_priority': 22 # sysfs.c:iscsi_sysfs_prop_get_ll():282
This change makes the libopeniscsiusr code ignore a read return of
EINVAL when ignore_error is set, treating it the same as a non-existent
sysfs file for optional attributes.
Signed-off-by: Chris Leech <cleech@redhat.com>
|
|\ \
| |/
|/| |
Fix iscsi-gen-initiatorname
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
This matches with iscsi-iname, which already exists and is
used by this script.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The iscsi-gen-initiatorname script seems only to be used by
the SUSE distrubution, so it has never been very "general". This
update makes the script more resiliant, with better error
messages if a problem occurs, as well as more generic, allowing
the caller to set the "base IQN" value, though the default
contains to be the same.
Changes:
- Added use of getopts to parse options
- Added a "-h" option for help
- Added an option to supply base IQN
- Added better checking of options and params
- Added comments to the script itself
- Now check to see if iname file can be written to
(handling read-only mounts better)
- Fixed initiator name listed in file (it was wrong)
- Removed use of printf(1)
- Fixed iBFT initiator name setting in general
- Now set iname file mode to 0600 even when it comes from
iBFT
- Cleaned up the script to use variables instead of repeating
file pathnames or other values
|
|\
| |
| | |
iscsiadm: Call log_init() first to fix a segmentation fault
|
|/
|
|
|
|
| |
log_init() should be called before log_error()
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
|
|
|
|
| |
cleaned up the new define using SBINDIR to match
the rest of the code.
|
|
|
|
|
| |
Two small bits in libopeniscsi usr were missed when
making sbindir configurable. One was just cosmetic.
|
|
|
|
| |
remove a merge error
|
|\
| |
| | |
Fix iscsi-init so that it runs when root writable
|
|/
|
|
|
|
|
|
|
|
| |
A recent commit, 432bbf979ee6 ("Remove dependences
from iscsi-init.service") removed DefaultDependencies from
iscsi-init.service, but that now means it can run so
early that the root disc is not yet writable, rendering
it useless, since it can't create the initiatorname.iscsi
file. This change tells it to wait until root is writable
to run.
|
|\
| |
| | |
iscsi sysfs: check state before onlining devs
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In 5.6, the commit:
commit 0ab710458da113a71c461c4df27e7f1353d9f864
Author: Bharath Ravi <rbharath@google.com>
Date: Sat Jan 25 01:19:25 2020 -0500
scsi: iscsi: Perform connection failure entirely in kernel space
made it so the kernel can start the recovery process. This means that
after the start conn operation the kernel could set the device into the
block stated. We can then hit a race where iscsid has done start conn,
and is calling session_online_devs but the kernel has hit an issue and is
now setting the device's to blocked.
This adds a check for if the device is in the offline state before trying
to set the state to running.
|