| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| | |
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.
|
|\
| |
| | |
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
|