This patch does not change any functionality but makes it easier
to port SCST to Linux kernel v4.11.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7152 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This change helped a secondary problem I had under valgrind (due to some other
bug) with initiators timing out and reconnecting their sessions faster than the
threads were getting cleaned up (for one thing, valgrind only ever runs one
thread at a time).
It seems logical that the code in conn_lookup() would want to skip any
connection that's already known closing in this case, for the same reason it
searches the list in reverse. And the dropping connections don't have to drop
in order, so searching in reverse doesn't seem sufficient to avoid finding a
wrong (stale, closing) connection structure.
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7144 d57e44dd-8a1f-0410-8b47-8ef2f437770f
In an error path in iscsi_threads_pool_get(), when a new pool cannot be
allocated, if there is a pool on iscsi_thread_pools_list, it passes that back as
an alternative, so return zero in that case.
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7143 d57e44dd-8a1f-0410-8b47-8ef2f437770f
In scsi_cmnd_start() conn->rx_task is intended to be set only during the
call to _stage1_done, but there was no code to reset it. It doesn't
actually matter in execution, but it was a little confusing to wonder
and try to understand why it wasn't reset.
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7142 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
Change local names of ioctl() and open() to not conflict with C library names.
This isn't really a bug in a strictly kernel-resident build, but the change
avoids symbol conflicts with libc when building for usermode.
Signed-off-by: David Butterfield <dab21774@gmail.com>
with some changes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7138 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Inspecting modules.symbols is fine after a kernel has been installed but
not if a kernel tree has not been installed. If a kernel tree has not
been installed, check the .config file.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7131 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
Move some #ifdefs to also cover declarations used only inside the #ifdef.
This is to avoid compiler warnings about unused variables.
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7121 d57e44dd-8a1f-0410-8b47-8ef2f437770f
DEF_DIF_FILENAME_TMPL should not have the parentheses; I used it in some
context where that became apparent.
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7120 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The "res" is unconditionally set by the call to scst_dg_sysfs_add(),
so setting it to ENOMEM above that is superfluous.
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7119 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Take lock before a call that ends up at the lockdep_assert_held() in
scst_del_free_acg() without locking.
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7118 d57e44dd-8a1f-0410-8b47-8ef2f437770f
scst_del_free_acg() does lockdep_assert_held(&scst_mutex), so we'd better take
the lock before calling it.
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7117 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Valgrind noticed that the "name" allocated in scst_proc_group_add() was
leaking. It turns out that scst_alloc_add_acg makes its own copy of the name
passed to it from this code, making the string duplication done here redundant
(and leaky). The change eliminates the string duplication (along with all its
associated error handling logic) and simply passes the (unowned) incoming
string down for duplication below.
Signed-off-by: David Butterfield <dab21774@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7115 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