This patch fixes the following Coverity complaint:
CID 271601 (#1 of 1): Uninitialized scalar variable (UNINIT)
uninit_use_in_call: Using uninitialized value req.
Field req.cid is uninitialized when calling iscsid_request.
There is a regular need in the kernel to provide a way to declare
having a dynamically sized set of trailing elements in a structure.
Kernel code should always use “flexible array members”[1] for these
cases. The older style of one-element or zero-length arrays should
no longer be used[2].
This code was transformed with the help of Coccinelle:
($ spatch --jobs $(getconf _NPROCESSORS_ONLN) --sp-file script.cocci --include-headers --dir . > output.patch)
@@
identifier S, member, array;
type T1, T2;
@@
struct S {
...
T1 member;
T2 array[
- 0
];
};
[1] https://en.wikipedia.org/wiki/Flexible_array_member
[2] https://www.kernel.org/doc/html/v5.16/process/deprecated.html#zero-length-and-one-element-arrays
Link: https://github.com/KSPP/linux/issues/78
Add the opportunity to globally specify multiple addresses, which
iSCSI/iSER portal will listen on.
There is a way to specify the addresses for a target, on which
portals it will be available, using the allowed_portal parameter.
There is also a way to set this globally via the iscsi-scstd
--address parameter. The problem is that the last option allows
you to specify only one local address. So extend this functionality
to specify more then one address.
Also increase the maximum number of listening addresses to 32.
Signed-off-by: Aleksandr Dyadyushkin <alextalker@ya.ru>
Move the $(SCST_INC_DIR) definitions from the out-of-tree sections into
the in-kernel sections. Since SCST is now distributed as a single tar
archive, only support in-tree builds with $(SCST_INC_DIR) and $(SCST_DIR).
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8079 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since all RHEL/CentOS 5 users have upgraded to a newer version, procfs
support is no longer necessary. Hence remove procfs support. This patch
has been generated as follows:
git grep -lw CONFIG_SCST_PROC iscsi-scst qla2x00t scst scst_local srpt |\
while read f; do
echo ${f}
unifdef -U CONFIG_SCST_PROC ${f} >${f}.out
mv ${f}.out ${f}
done
followed by two small manual edits in scst/include/scst.h and also in
qla2x00t/qla2x00-target/qla2x00t.c.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7999 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Daemon now handles receipt of EOF (rc == 0) from nl_fd. Probably this never
happens in a real kernel build, but it does during shutdown in a usermode build
and it seems like it is "generically correct" in either case.
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7140 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Add "XXX" comments in a few places about potential problems seen in SCST code,
for future investigation and possible repair.
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7123 d57e44dd-8a1f-0410-8b47-8ef2f437770f
casting const to non-const
uninitialized structure members
non-static local function
missing enumerated switch-value cases
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7122 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This fixes four similar instances of a very misleading and confusing logging
statement, which would print a "Wrong value" that had already been corrected by
the check function.
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7112 d57e44dd-8a1f-0410-8b47-8ef2f437770f
to exist as valid addressable memory beyond the NULL byte.
Signed-off-by: David Butterfield <dab21774@gmail.com>
with small addition to force set last byte NULL
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7109 d57e44dd-8a1f-0410-8b47-8ef2f437770f
target_del() calls handle_iscsi_events() which may recursively call target_del().
The 1st target_del() may resume its execution after the target object was already freed.
Signed-off-by: Erez Zilber <erezzi.list@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6908 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Additionally, surround complex values with parentheses, declare static
char arrays const and change C++ comments into C comments.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6849 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that the compiler reports warnings about strict aliasing when
building iscsi-scst on RHEL 6. This patch does not change any
functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6414 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that gcc reports the following compiler warning:
message.c:197:44: warning: 'rsp_data_sz' may be used uninitialized in this function [-Wmaybe-uninitialized]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6386 d57e44dd-8a1f-0410-8b47-8ef2f437770f