| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* iscsid/iscsiuio: fix OOM adjustment
For both the iscsid and iscsiuio daemons, they try to modify
nice value and OOM adjustment value, so they have priority
and will not be killed by the OOM-killer.
But the code incorrectly set the value to "-17" for modern
linux systems, when the maximum is actually "-1000". While
making the changes, use "/proc/self/..." instead of
"/proc/<PID>/...", so we don't have to use getpid() nor
print out the pathname. Now we either write "-16" to
the old interface, "-1000" to the new interface, or we
print a warning.
Several "log_debug()" calls that should have been warnings
are changed to "log_warning()" calls in iscsid.
* iscsid/iscsiuio: fix OOM adjustment value for older systems
On older linux system, "-17" is the maximum, not "-16".
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Build: Add an iscsiuio 'build_date.sh' script
This is currently unused, but will be used by meson to
build the "build_date.[ch]" files used by iscsiuio.
* Build: have git ignore file '.setup'
I commonly use this file for shell aliases/functions.
* Add framework to support building using meson.
This adds the ability to use meson/ninja to build open-iscsi
and iscsiuio, rather than the current system that uses 'autoconf'
for iscsiuio and uses 'make' for everything else.
The old make/autoconf system is left in place, for now, but
deprecated, including a warning about that when running 'make all'
or 'make user' from the top-level.
* utils/build: enhance iscsi-iname to generate prefix
Added new "-g/--generate-iname-prefix" argument to generate the
InitiatorName= prefix. Also, updated iscsi-iname to use getopts.
Also, use the new option from meson.
* git/meson: remove 'builddir' from ignored files
The build directory can be called anything.
Suggested by: Eli Schwartz
* iscsiuio build: fix new build_date.sh script
Fixed several issues:
- fix option handling for "-S"
- fix epoch date handling from env (noticed by Eli Schwartz)
- remove debug statements
* iscsiuio meson: warn when not creating a symlink for iscsiuio
* meson: install man pages more efficiently
We don't need to specify path or subdirectory
* iscsiuio meson: remove unused source date epoch option
This option was never used, since we pass this info
from the environment.
* meson: no need to set libdir: default is fine
* iscsiuio meson: no need to add c_args: already there
* Don't generate initiatorname when cross-building (#367)
Let it be generated by the iscsi-init service.
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
* Set ISCSI_CONFIG_ROOT by meson
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
* Set LOCK_DIR from home_dir to lock_dir
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
* Install iface.example to db_root/ifaces
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
Signed-off-by: TIAN Yuanhao <tianyuanhao3@163.com>
Co-authored-by: TIAN Yuanhao <78596099+tianyuanhao@users.noreply.github.com>
Co-authored-by: TIAN Yuanhao <tianyuanhao3@163.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* build: move utils/sysdeps to top-level
The routines here are used by iscsiuio, so
move them to the top level.
* libopeniscsiusr: fix kernel-doc bugs
There were errors in four places, effecting the generated
manual pages.
* libopeniscsiusr: clean up kernel-doc usage
Simplify generation of library interface documentation using
the kernel-doc script:
* make the kernel-doc perl script executble (the only visible change)
* remove mention of sed (not used)
* stop compressing man pages -- let distros do that
* improve kernel-doc so that doc-preclean.pl and split-man.pl
are no longer needed
* add list-man-pages.sh to simplify things (copied from libnvme)
* build: keep current version number in one place
Move the current version number (now 2.1.7) into
the top-level Makefile, and out of usr/version.h and
libopeniscsiusr/version.h, completely eliminating the
need for the latter.
Note that this ties the libopeniscsiusr library idea of
"version" to the usr/ (iscsid, etc) idea of version, even
though they used to be defined separately. But they always
had the same value, so nothing lost.
* build: insteall man pages uncompressed
We were delivering some man pages compressed and other not, and
it turns out distros know how to install man pages using the
compression they prefer, so stop doing it for them.
|
|
|
|
|
| |
* Ignore template-generated man pages
* build: fwparam_ibft does not need libopeniscsiusr
|
| |
|
|\
| |
| | |
Add ability to specify name-value parameters when creating a new iface
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add ability to specify name-value parameters when creating a new iface
like following:
root# iscsiadm -m iface -I test -o new -n iface.initiatorname -v iqn.2016-04.com.open-iscsi:17a3c9bc2d
test updated.
New interface test added
root# iscsiadm -m iface -I test | grep initiatorname
iface.initiatorname = iqn.2016-04.com.open-iscsi:17a3c9bc2d
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Specifying name-value pairs as arguments to iscsistart or
iscsiadm can become unwieldy very quickly, and is less flexible
than using a config file. If a user desires to update settings,
modifying a config file and rebuilding initramfs can be simpler
than modifying arguments directly in initramfs code or scripts.
Node records created from boot context are populated with
defaults, then any settings specified in a config file are
applied (if config is present).
FW and user-specified params are still applicable. User-specified
name-value arguments are applied after config settings, so they
can serve as a safeguard against config file changes if
desired.
Added -c|--config options for iscsistart to specify the config
Updated iscsistart man page
Signed-off-by: Eric Mackay <eric.mackay@oracle.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The default behavior in iscsid, which is to check mgmt IPCs
for UID==0 and user explicitly named "root", is unchanged.
This option to perform only the UID check for management
IPCs can be enabled in iscsid.conf. This can be useful for
running iscsid in a constrained environment, e.g., initramfs.
For instance, klibc initramfs in Ubuntu and Debian does not
include a user DB. Attempting to run iscsid and iscsiadm
in klibc initramfs would result in ISCSI_ERR_ACCESS for
all MGMT IPCs. Specifying just the UID check allows iscsid
and iscsiadm to run in klibc initramfs without a user DB.
systemd can still start an iscsid process later in boot with
the default full MGMT IPC auth checks, leaving the steady-state
behavior of iscsid the same as before.
The following setting in iscsid.conf enables this behavior:
iscsid.ipc_auth_uid = Yes
iscsistart now uses this mechanism to only perform the UID
check, rather than statically linking against an alternate
implementation of getpwuid(). This is effectively the same
behavior as before.
Signed-off-by: Eric Mackay <eric.mackay@oracle.com>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This cleans up a little more than "make clean",
in particular removing files generated from templates,
and automake-generated files in iscsiuio.
Also, a ".PHONY:" target was added where needed
so that each Makefile has a complete list of
phony targets.
|
|\ \
| | |
| | | |
iscsid: fix logout pdu send failure detection handling
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes a bug where when we send logout pdu we are incorrectly
handling it as an error. This was added in
https://github.com/open-iscsi/open-iscsi/pull/317
I think there might have been a mistake for which version of that patch
got merged because there are some unhandled review comments in the merged
code.
The patch also fixes some review comments that were given in that review
but were not handled when it was merged:
1. No space before "Dropping session"
2. Don't split error messages.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This build has lex and bison source files, but
they are not normally used to regenerate C files,
since that has been done ahead of time, statically,
to handle the case when users building the software
may not have these tools. But some build systems
think the generated C files need to be regenerated
because the timestamp on the source and generated
files is so close, just because of the order the
files were populated in this directory. So we tell
the Makefile to only generate C files if those
files are missing. This should have no effect,
since these files should never need to be
regenerated unless we change lex or bison logic.
|
|\
| |
| | |
Build system tweaks from downstream
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- On my system, sed appears to be at /bin/sed. So, let's allow overriding
the location.
- Allow different pkg-config paths too (useful for cross).
Signed-off-by: Sam James <sam@gentoo.org>
|
| |
| |
| |
| |
| |
| |
| | |
- Don't hardcode GCC, instead respect the detected CC (or from the environment)
- Use $(RM) as the location may vary and we've already done the work to detect it
Signed-off-by: Sam James <sam@gentoo.org>
|
|/
|
|
|
|
| |
This is already done for libkod in usr/Makefile, so do the same
for libsystemd, even though most times these flags will be empty,
that is not always the case.
|
|
|
|
|
|
| |
Moving these files, as done recently, means they now can
be compiled with different (more strict) options, so mark
unused params as such.
|
|
|
|
| |
These files are apparently unused, so remove them.
|
|
|
|
|
|
|
| |
Commit 61443d7db7de ("Build: Cleanup fwparam_ibft and sysdeps subdirs."
changed the "clean" target in usr/Makefile so that it no longer
removed all object files, rather just removing the ones it knows
about. But that commit missed some object files.
|
|
|
|
| |
Help explain some of the mystery of this directory.
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit moves the "fwparam_ibft" subdirectory from
being under "utils" to being under "usr", where its
actually used. It also updates usr/Makefile so that
it's smarter about how and when to build the fwparam_ibft
object files it needs, as well as how to build sysdeps.o.
From the top-level Makefile, "make user" will now make
the fwparam_ibft files, as needed for the "user" targets,
before building iscsid and friends.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit adds two new top-level build options: one
for the "home" directory for open-iscsi called "HOMEDIR",
and one for the "database" directory, called "DBROOT". One can
now override the defaults of "/etc/iscsi" for either or
both of these directories on the make command line.
The README and man pages are updated with details about
these new options.
Some Makefile cleanup/repair was done as well. Installation
of the initiatorname.iscsi file, was moved out of the top-level
Makefile into the etc subdirectory, and installation of man
ages moved from the top-level Makefile to the doc subdirectory.
Also, this fixes some issues from commit fd14dd8316b1 ("Clean
p Makefile build system."), which incorrectly changed the DESTDIR
ariable in the Makefiles. This current commit also fixes the
top-level variable names for moving DBROOT and HOMEDIR.
|
|
|
|
| |
Just a little grammar cleanup.
|
|\
| |
| | |
Clean up Makefile build system.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A major overdue overhaul of the Make layout, including
moving lots of lower-level things out of the top-level
Makefile into the Makefiles for the appropriate subdirectory,
renaming the template files (where @SBINDIR@ gets translated)
so that their purpose is more obvious, making the build more
idempotent (no need to install a file if it's not newer).
Should be no functional change, as no script or C file changed.
Main difference from before: now the udev rules gets made and
installed by default (as part of "make"/"make install"), and
the iscsiuio daemon is now installed for "make install".
One should now be able to go into any subdirectory and type
"make"/"make install" to build and install the targets from
that directory, at least for the etc, utils, and usr
subdirectories.
This change is in preparation for more template translations
coming.
|
|/
|
|
|
|
|
|
|
|
|
| |
This adds 2 things to the firmware login mode: first, it adds
sane default values for NOP-OUTs (off), login retry max, and
type of scan. Lastly, it also gives the caller the ability
to set name/value pairs on the command line, which gives the
ability to override these new defaults if desired.
The output of "iscsiadm -h" was also cleaned up a bit, removing
duplicate spaces.
|
|
|
|
|
|
|
| |
print the failure reason of iscsi_send_logout() which is helpful
to locate problem when error happened.
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If iscsi_send_logout() is called from iscsi_stop() or
session_login_task() and return 0, the next logout flow such as
session_conn_shutdown() depends on target's logout response and
logout timeout.
While if iscsi_send_logout() failed to trigger a logout timeout task,
and target's logout response absent, the logout flow would hang.
So we should return error if iscsi_send_logout() failed to trigger
a logout timeout task.
And add comment about handle logic if iscsi_send_logout() failed from
iscsi_recv_async_msg() by hand.
Signed-off-by: Wenchao Hao <haowenchao@huawei.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>
|
| | |
|
|/ |
|
|\
| |
| | |
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>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
log_init() should be called before log_error()
Signed-off-by: Wenchao Hao <haowenchao@huawei.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|