| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
Finish ability to have binaries in an alternate location
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A Recent commit, fff82c57f5df ("Use "sbindir" for
path in systemd service files") added the ability
to have our binaries in another location rather
than /sbin (e.g. /usr/sbin), but it was incomplete.
This commit finishes the job.
Fixes: fff82c57f5dfe6d3db795f1195b4d2ebc497d33c
|
|/
|
|
|
|
|
|
| |
Remove stuff about a kernel module, since that's
ancient history. Also, add a bit about compiling
iscsiuio, since it's part of open-iscsi now, and
lastly update info on putting the binaries some
place other than /sbin, if desired.
|
|\
| |
| | |
Use "sbindir" for path in systemd service files
|
|/
|
|
|
|
|
|
|
|
| |
Use a variable for the sbin directory where executables
go in our systemd unit files, so that the files can
be configured, during installation, to have the
correct path, instead of just hard-coding these paths.
Now "make sbindir=/SOME/PATH ..." works correctly for
different paths.
|
|\
| |
| | |
Remove dependences from iscsi-init.service
|
|/
|
|
|
|
|
| |
Since iscsid.service depends on it but disables
default dependencies, iscsi-init.service must
also disable default dependencies, or a dependency
loop can be created.
|
|\
| |
| | |
Fix compiler error introduced with recent IPv6 commit.
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Commit 76350316de38 ("Handle IPv6 interfaces correctly.") added
a string copy that creates this gcc-11 error message:
> gcc-11 -O2 -g -Wall -Werror -Wextra -fvisibility=hidden -fPIC -I/usr/include/kmod -c -o idbm.o idbm.c
> idbm.c: In function ‘_idbm_node_rec_link’:
> idbm.c:999:17: error: ‘strncpy’ specified bound 65 equals destination size [-Werror=stringop-truncation]
> 999 | strncpy((*node).iface.name, iface_name, ISCSI_MAX_IFACE_LEN);
> | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So copy one less character, maximum.
|
| |
|
|\
| |
| | |
Handle ipv6 better
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For IPv6 interface files (in iscsi/ifaces), assume
the interface uses IPv4 unless it has "ipv6" in the
name. Also, when creating interface files, name
them ending with "ipv6.N" or "ipv4.N", where "N" is
the interface number (normally zero). This was
being done in one place, and this commit makes
sure all places that create interface files use
this convention.
Note that iscsiadm cannot determine if the interface
file is IPv6 vs IPv4 from the contents because of
the way it processes those files: it creates a template
of "legal" values, then processes the file. But it
needs to know IPv4 vs IPv6 when creating the template.
|
| |
| |
| |
| |
| | |
Clarify/clean up the discovery mode synopsis,
and clean up the description of discovery mode.
|
| |
| |
| |
| |
| | |
Make it clear that ipv6 interface files need
to have the string "ipv6" in their names.
|
| |
| |
| |
| |
| |
| |
| | |
This lets the compiler help us find errors, if any.
Change the declaration and usage to match. Simplify
the function that decides, while we are at it. Should
be no functional change.
|
| |
| |
| |
| |
| |
| |
| | |
Use the correct driver, and handle the NPAR 4-MAC-ADDr offset
of qedi, unlike other Offload cards.
Found-by: David Bond <DBond@suse.com>
|
|\ \
| |/
|/| |
Handle recv() returning 0 in iscsid_response()
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Description:
------------
Due to any issue on target side or any other underlying network issue, the initiator will get "connection refused" error when it tries to connect to the iscsi target. Once it gets the connection refused error, the error handler will try to re-connect to the target after 3 seconds and this will be repeated till the timeout of 120 seconds for the initial login. After this, the connection will be terminated and shutdown.
After this, when the image installation started to upgrade the iscsi-initiator-utils, first systemd tried to Reload the daemon and started tryign to login iscsi devicces, which triggered the iscsi connection to the target which was down (for which we had the initial login failed as mentioned above). This trigger of connection was from the iscsiadm (iscsi.service) which got the connection refused error. So, it will be retried. But now systemd stopped the iscsid for updating the iscsi-initiator-utils which was started again later. Since the iscsid daemon was stopped, the retry logic in iscsid_response() function kept polling and went into indefinite loop:
int iscsid_response(int fd, iscsiadm_cmd_e cmd, iscsiadm_rsp_t *rsp,
int timeout)
{
...
...
while (len) {
struct pollfd pfd;
pfd.fd = fd;
pfd.events = POLLIN;
err = poll(&pfd, 1, timeout); <<< This poll returned err = 1
if (!err) {
if (poll_wait)
continue;
return ISCSI_ERR_SESSION_NOT_CONNECTED;
} else if (err < 0) {
if (errno == EINTR)
continue;
log_error("got poll error (%d/%d), daemon died?",
err, errno);
return ISCSI_ERR_ISCSID_COMM_ERR;
} else if (pfd.revents & POLLIN) { <<< We came here which returned 0
err = recv(fd, rsp, sizeof(*rsp), MSG_WAITALL);
if (err < 0) {
log_error("read error (%d/%d), daemon died?",
err, errno);
break;
}
len -= err;
iscsi_err = rsp->err;
}
}
...
...
}
In the above code poll() was returning 1 (indicating success and the poll fd was existing and will be closed only after this while loop) and revents was set to POLLIN. So, we enetered the last "else if" block and tried to recv the message from the target. Since the target was shutdown gracefully (due to which we were getting connection refused errors), the recv() call returned 0 as no bytes were received. Since the bytes received was 0, the value of "len" did not change due to which the while loop is repeated again. The status on pfd was not changed as there was nobody to change it and also it was not yet closed (will be closed only after the while loop is exited). So, the poll again returned 1. Hence we again tried to receive the bytes from target which again returned 0. So, this went into infinite loop and hence the iscsi.service got stuck on iscsiadm. This caused the iscsi-initiator-utils update process to get stuck and in-turn the image installation got stuck.
Fix:
The fix is to handle the case, by exiting the while loop, when the recv() returns the 0 bytes indicating that the remote target service (the peer) had an orderly shutdown.
|
|\
| |
| | |
iscsid: set PR_SET_IO_FLUSHER
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When iscsid makes syscalls that lead to memory allocations the kernel
might use GFP_KERNEL. This can lead to pages being written to iscsi
disks managed by iscsid. If we are doing a syscall to try and reconnect
the session the disk is accessed through then we could deadlock.
When in the iscsi layer we can select our GFP flags but when making
syscalls to the network layer we have to set PR_SET_IO_FLUSHER so we
use the correct GFP flags.
Signed-off-by: Mike Christie <michael.christie@oracle.com>
|
|\ \
| |/
|/| |
bnx2x.c: Re-initialize bp->version with baseline version.
|
| |
| |
| |
| |
| |
| |
| |
| | |
In case eth device failed to return correct version,
then we will initialize bp->version with baseline instead
of assigning unknown version number.
Signed-off-by: Manish Rangankar <mrangankar@marvell.com>
|
|\ \
| |/
|/| |
Support the "qede" CNA-card driver.
|
| |
| |
| |
| | |
The iscsi_offload command needs to recognize the "qede" driver.
|
|\ \
| | |
| | | |
iscsistart: fix null pointer deref before exit
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes regression caused by "open-iscsi: Clean user_param list when
process exit" Which is a shame, as not freeing a memory at process exit
doesn't really hurt anything.
Same change as "Fix iscsiadm segfault when exiting" applied to iscsiadm.
Fixes: b532ad67d495d42026165a26515c645995d23f18
Signed-off-by: Chris Leech <cleech@redhat.com>
|
|\ \
| |/
|/| |
Set default 'startup' to 'onboot' for FW nodes
|
|/
|
|
|
|
|
|
|
|
| |
When "iscsiadm -m discovery -t fw" is ran, nodes are
created/updated in the node DB for each firmware target
found, but the 'startup' mode values are left as 'manual',
when in fact firmware nodes are treated as if this
value is 'onboot'. So to keep the node DB in sync with
behavior, set these to 'onboot' by default. This
should *not* effect any other functionality.
|
|\
| |
| | |
Add iscsiadm "no wait" option for firmware login.
|
|/
|
|
|
| |
In addition, update the iscsiadm help message, and the
iscsiadm man page.
|
|\
| |
| | |
Check ISCSI_ERR_ISCSID_NOTCONN in iscsistart login
|
|/
|
| |
In login_session() function, we need to check for error ISCSI_ERR_ISCSID_NOTCONN also. When the login command is sent to the iscsid using iscsid_exec_req(), it will try to connect to iscsid using the function ipc_connect(). If there is an issue in iscsid or if we are not able to create the socket due to some reason, then the error ISCSI_ERR_ISCSID_NOTCONN is returned. We need to retry the login command by checking the error ISCSI_ERR_ISCSID_NOTCONN.
|
|\
| |
| | |
Log error message when auth debug status is set
|
|/
|
| |
Log the correct error message in /var/log/messages when the debug status is set when there is an authentication error. The change is made in check_security_stage_status() function. This issue was identified when one of the customer was trying to login to the iscsi target after configuring the mutual CHAP authentication. They set the same password for both side authentication. This is not allowed as per the code as it was returning AUTH_DBG_STATUS_PASSWD_IDENTICAL. The error logged in /var/log/messages was not obvious. This change will help to understand the correct error message so that required action can be taken.
|
| |
|
|\
| |
| | |
Iscsi sessions get
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
through iscsi_sessions_get()
Suppress the error message from iscsi_session_get when it's being called
through iscsi_sessions_get now that it's not being treated as an error.
There's no reason to be so alarmed the session being read in isn't
specified exactly.
Signed-off-by: Chris Leech <cleech@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When looping over all sessions with iscsi_sessions_get, it's possible to
race against sessions being destroyed and have the sysfs attribute files
be removed before they're read. Let's not treat this as an error, and
simply drop the session that failed to read from the list. I think it
makes sense to treat session that disapear while they're being read as
if they were already gone when the sessions directory was first scanned.
Apparently having iscsiadm exit with an error when trying to get a list
of sessions is a problem for OpenStack deployments.
Signed-off-by: Chris Leech <cleech@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The error message in iscsi_session_get [libopeniscsiusr/session.c:140]
when a session or connection path isn't found in sysfs was failing to
print the session ID, instead it printed the address of the static
string for the remainder of the message ("does not exists") due to an
extra comma.
Additionally change all occurances of "does not exists" to "does not
exist"
Signed-off-by: Chris Leech <cleech@redhat.com>
|
|\ \
| |/
|/| |
Enable iscsi.service asynchronous logins, cleanup services
|
|/
|
|
|
|
|
|
|
| |
Add the "-W" (no wait) flag to the iscsiadm login command in
iscsi.service, so that the service succeeds even if one or more
of the targets being logged on to is not available at startup
time.
Also, clean up the iscsi.service and iscsid.service files.
|
|\
| |
| | |
Avoid hardcoding pkg-config to fix cross build
|
|/
|
|
| |
Debian Bug: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=982307
|
|\
| |
| | |
Fix iscsistart login issue when target is delayed.
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Earlier commit 9258c8eae046 changed the return value fron
iscsid_response() from ISCSI_ERR_ISCSID_NOTCONN to
ISCSI_ERR_SESSION_NOT_CONNECTED in the case where no iscsi response is
received when expected.
This effected the login code in iscsistart when the target is not
completely ready at iscsi login time. This commit updates iscsistart
to expect the new error code, but fixing this uncovered another issue,
causing iscsistart logins to continue to fail if the target returned its
login response too slowly.
This commit ups the timeout time for iscsistart logins from 1 second per
try to 10 seconds per try. This is perhaps excessive, and a shorter
delay would be more appropriate, but the retry/nanosleep logic in
iscsistart meant to retry the login in such cases seems problematic in
this case, since retrying the 2nd time returns "session already exists",
and most iscsistart clients aren't prepared for the command to return a
non-zero return value.
|
|\
| |
| | |
Wants=network-online.target in iscsi.service
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Setting After= without Requires= or Wants= is not enough to pull
network-online.target as a dependency.
Currently, if some other service requires network-online.target
then iscsi.service is started after network-online.target
If no any other services require network-online.target then
iscsi.service may be started before networking is working.
The latter leads to the following issues:
iscsiadm: Could not login to [iface: default, target: XXX, portal: XXX,3260].
iscsiadm: initiator reported error (4 - encountered connection failure)
Reference: https://www.freedesktop.org/wiki/Software/systemd/NetworkTarget/
|
|
|
|
|
|
|
|
|
|
| |
Commit b532ad67d495d added some cleanup code
to iscsiadm right before it exits, but it
used a list_for_each_entry() to iterate through
a list was being deleted, when it should use
list_for_each_entry_safe().
Fixes: b532ad67d495d
|
|\
| |
| | |
iscsid: Add NO_SYSTEMD to CFLAGS
|