In Linux kernel v5.9 use of the KERNEL_SOCKPTR() function is mandatory
when calling setsockopt(). Implement that function for kernels before v5.9.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9149 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch is necessary to make SCST work with Linux kernel v5.1 and
does not change any functionality. See also upstream commit 736706bee329
("get rid of legacy 'get_ds()' function").
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8057 d57e44dd-8a1f-0410-8b47-8ef2f437770f
conn->sock is set by the TCP/IP transport but not by the iSER transport.
Hence check the conn->sock pointer from common code before dereferencing it.
Reported-by: Doug Dumitru <doug@easyco.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8051 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
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
It adds target_ip attribute containing target IP address in each
/sys/kernel/scst_tgt/targets/iscsi/TARGET/sessions/INITIATOR/INITIATOR_IP subdirectory.
It's useful to simplify monitoring management utilities
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7067 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The C language does not require to use an explicit cast when assigning
a void * pointer to a pointer of another type.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6633 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that checkpatch reports the following warning:
WARNING: type 'long long unsigned' should be specified in 'unsigned long long' order.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5885 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The lockdep_assert_held() macro is a convenient debugging tool.
However, it is inconvenient to surround each invocation of that
macro by an #ifdef/#endif pair. Hence make it easier to use this
macro with older kernel versions.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5573 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Fix the following checkpatch 3.14 warning:
Unnecessary parentheses - maybe == should be = ?
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5435 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that sparse complains about a local symbol not having been declared
static (scst_pool_dep_map and scst_conn_dep_map). Also avoid that sparse
reports these two variables as unused in the procfs build.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5110 d57e44dd-8a1f-0410-8b47-8ef2f437770f
the timeout value. The problem is that if commands were started at
00:00:05 and 00:00:10 and the timeout value was 15 seconds and the
first command completed ok, then conn_rsp_timer_fn would have run
at 00:00:20 and rescheduled the next conn_rsp_timer_fn run for 15
secs from that time (00:00:35). But, we would have wanted to check on
the second command at 15 secs after its write_start time which is
00:00:25.
This patch has us reschedule the next conn_rsp_timer_fn run for
the req's write_start time + its timeout.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5093 d57e44dd-8a1f-0410-8b47-8ef2f437770f
1. If we have a nop in flight then we do not really need to send
more to test if the other side is still there. Either that nop
will timeout and conn will be dropped or it will complete
and last_rcv_time will be updated.
2. We are sending nop-ins every nop_in_interval seconds, but if
we got a data half way in to the window, then when conn_nop_in_delayed_work_fn
is run it was scheduling the next check to be nop_in_interval more
seconds. With the current settings this could end up with us waiting
59 secs before sending a nop and about 130 secs for it to timeout, when
at 61 it should be timing out and getting cleaned up already. This patch
has us take into account when the last time we got data to try and
reschedule the next nop check closer to nop_in_interval from that time.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5092 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch does not change any functionality other than the message
printed when it takes more than one second before the completion is
signalled.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5086 d57e44dd-8a1f-0410-8b47-8ef2f437770f