245 Commits

Author SHA1 Message Date
Chesnokov Gleb
41943ed156 iscsi-scst: Remove support for kernel versions before 3.10
The SCST has dropped support for kernels older than 3.10.0 (RHEL 7 / Centos 7) since SCST v3.6.
2022-01-13 17:26:37 +03:00
Bart Van Assche
a673470ce3 scst, iscsi-scst: Use struct kvec instead of struct iovec for kernel data
This patch does not change any functionality but removes multiple __force
__user casts.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9197 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-11-27 03:45:16 +00:00
Bart Van Assche
186798cec4 Use the fallthrough macro instead of a comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9166 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-09-16 14:28:36 +00:00
Bart Van Assche
bd3aa5d4a5 iscsi-scst: Port to Linux kernel v5.9
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
2020-08-29 21:16:47 +00:00
Bart Van Assche
f7b704ee99 scst, iscsi-scst: Port to RHEL / CentOS 8.2
Apparently the Linux kernel v4.20 iov_iter_kvec() function has been
backported to RHEL / CentOS 8.2. This patch fixes the following kernel
warning:

WARNING: CPU: 26 PID: 21141 at lib/iov_iter.c:1083 iov_iter_kvec+0x25/0x30
Call Trace:
 fileio_exec_async+0x216/0x3a0 [scst_vdisk]
 fileio_exec_write+0x3b9/0x450 [scst_vdisk]
 vdev_do_job+0x34/0xc0 [scst_vdisk]
 scst_do_real_exec+0x54/0x100 [scst]
 scst_exec_check_blocking+0xbb/0x210 [scst]
 scst_process_active_cmd+0x64d/0x1550 [scst]
 scst_cmd_thread+0x170/0x5a0 [scst]
 kthread+0x112/0x130
 ret_from_fork+0x35/0x40

See also https://github.com/bvanassche/scst/issues/26.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9026 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-17 01:35:53 +00:00
Bart Van Assche
f0e474c4d8 iscsi-scst: Suppress multiple Coverity complaints
Suppress several Coverity "tainted scalar" complaints and also two other
false positive Coverity complaints.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8761 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-01-12 05:37:34 +00:00
Bart Van Assche
d85e33dbcc iscsi-scst: Serialize socket disconnect calls properly
This patch fixes the following kernel complaint:

WARNING: suspicious RCU usage
include/net/sock.h:1907 suspicious rcu_dereference_protected() usage!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
no locks held by iscsi_conn_clea/18329.
stack backtrace:
Call Trace:
 dump_stack+0xa5/0xe6
 lockdep_rcu_suspicious+0x107/0x111
 tcp_disconnect+0x9ee/0xa60
 iscsi_tcp_conn_close+0x5d/0x90 [iscsi_scst]
 close_conn+0xcfe/0x1470 [iscsi_scst]
 close_conn_thr+0x54/0x80 [iscsi_scst]
 kthread+0x1bc/0x210
 ret_from_fork+0x24/0x30

Fixes: commit ba3062fe6b ("iscsi-scst: Improve connection shutdown time";
r297).


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8693 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-23 18:51:02 +00:00
Bart Van Assche
f22d4bb63b scst, fcst, iscsi-scst, qla2x00t, srpt: Add module namespace support
This patch adds support for kernel module namespaces. This patch is essential
when using SCST in combination with kernel version v5.4 or later.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8673 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-11-30 00:54:20 +00:00
Bart Van Assche
c6c6a94965 iscsi: Remove a debug assert
Remove this debug assert because it a write residual can happen, e.g. if the
expected transfer length exceeds the Data Out buffer length. This statement
was hit by the following CDB, submitted by the libiscsi regression tests:

[14896]: scst: scst_parse_cmd:1235:Warning: expected transfer length 0 (DIF 0) for opcode WRITE(10) (handler vdisk_fileio, target iscsi) doesn't match decoded value 512
[14896]: scst_parse_cmd:1243:Suspicious CDB:
 (h)___0__1__2__3__4__5__6__7__8__9__A__B__C__D__E__F
   0: 2a 00 00 00 00 00 00 00 01 00   *.........



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8659 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-11-17 19:19:09 +00:00
Bart Van Assche
81bc0e717a iscsi-scst: Suppress a false positive Coverity complaint
Avoid that Coverity complains about using a scalar as an array.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8369 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-27 17:31:40 +00:00
Bart Van Assche
3b76bc5b1f Use KERNEL_DS instead of get_ds()
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
2019-03-18 00:24:56 +00:00
Bart Van Assche
d1f7b0aae8 iscsi-scst: Fix multiple checkpatch warnings
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8050 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-03-11 03:57:09 +00:00
Bart Van Assche
08e532715d Remove procfs support
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
2019-03-02 20:04:25 +00:00
Bart Van Assche
5a1474df43 scst, iscsi-scst: Port to Linux kernel v4.20
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7810 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-11-10 17:51:41 +00:00
Bart Van Assche
e79fcbd8f3 iscsi-scst: Remove zero-copy TCP/IP support
Zero-copy TCP/IP support is deprecated since a while and is no longer
supported for recent kernels. Hence remove it and also all references
to zero-copy TCP/IP support.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7809 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-11-10 17:50:59 +00:00
Bart Van Assche
9fff6bc1f0 iscsi-scst: Declare cmnd_alloc() static
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7808 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-11-10 17:48:33 +00:00
Bart Van Assche
4c01448dfa iscsi-scst: Simplify iscsi_get_initiator_port_transport_id()
From the snprintf() man page:
    
If n is zero, nothing shall be written and s may be a null pointer.

This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7435 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-07-23 04:23:26 +00:00
Vladislav Bolkhovitin
f549829482 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7396 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-04-12 03:49:10 +00:00
Bart Van Assche
9246a05f7e Fix kernel-doc warnings
Avoid that building SCST with W=1 against kernel v4.15 triggers warnings about
kernel-doc header issues.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7298 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-12-29 22:34:17 +00:00
Bart Van Assche
9e35afe1e0 Annotate fall-through in switch statements in a form recognized by gcc 7
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7216 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-08-27 15:28:57 +00:00
Bart Van Assche
642744c9fc Fix spelling of "Ardis Technologies"
Reference: http://www.ddpsan.com/support-sales/about-us.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7165 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-05-02 22:32:06 +00:00
Vladislav Bolkhovitin
68fa7e1a0d Copyright updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2017-04-22 03:19:52 +00:00
Vladislav Bolkhovitin
296f133caf iscsi-scst: fix ENOMEM path
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
2017-04-21 01:32:07 +00:00
Vladislav Bolkhovitin
0e92843d30 iscsi-scst: reset conn->rx_task in scsi_cmnd_start() for EXTRACHECKS
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
2017-04-21 01:17:53 +00:00
Vladislav Bolkhovitin
eaa99a8770 Fix a few minor "extra" compiler warnings (mostly "const" issues)
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
2017-04-14 01:03:25 +00:00
Vladislav Bolkhovitin
c9b301bf39 iscsi-scst: add per_sess_dedicated_tgt_threads attribute in ini groups
If this attrubute is set, each iSCSI session for this initiator has
dedicated, i.e. not shared with other sessions, pool of the iscsi{wr,rd}
kernel threads.

Useful to control per-session CPU affinity to improve performance.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7069 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-12-20 06:00:43 +00:00
Vladislav Bolkhovitin
df55eeb5da Minor misc changes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7068 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-12-20 05:55:19 +00:00
Vladislav Bolkhovitin
1f72d604cc iscsi-scst: fix false positive BUG_ON()
It's false positive, because responses live in the parent request's list
until last put for the parent.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7009 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-10-14 01:30:17 +00:00
Vladislav Bolkhovitin
3c6e21704f iscsi: convert recently added BUG_ON() to EXTRACHECKS_BUG_ON()
This check is rather debug check, so should belong to debug build only



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6980 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-08-24 02:05:03 +00:00
Bart Van Assche
0d438351f9 iscsi-scst: Change (signed) into (signed int)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6975 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-08-22 17:05:07 +00:00
Israel Rukshin
a3b45f61bf isert: add assertions for connection teardwon flow
Signed-off-by: Israel Rukshin <israelr@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6936 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-08-17 07:27:11 +00:00
Vladislav Bolkhovitin
244271120e iscsi-scst: increase past CmdSN window to 2048
On modern storage there might be more, than 128, commands queued, so
previous CmdSN window might be too small and on unstable networks lead
to infinite retries. For more infor see thread
https://sourceforge.net/p/scst/mailman/message/35238904.

Reported-By: Lev Vainblat <lev@zadarastorage.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6917 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-07-26 01:42:26 +00:00
Vladislav Bolkhovitin
fa2f54ac9e Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6787 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2016-01-22 04:04:43 +00:00
Bart Van Assche
0597ac78c8 iscsi-scst: Fix IPv6 format specifications
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6670 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-11 22:05:05 +00:00
Bart Van Assche
469fe4a42c iscsi-scst: Remove superfluous casts
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
2015-11-09 19:51:17 +00:00
Bart Van Assche
7614eafd64 iscsi-scst: Insert a blank line after declarations
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6616 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-11-07 00:00:42 +00:00
Vladislav Bolkhovitin
45d7f40ec1 Improve release logging
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6478 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-08-25 02:57:51 +00:00
Vladislav Bolkhovitin
e5e54f312b iscsi-scst: Move old TM response dropping to preparing new response stage
The second TM request can come while the old one, response for which is
going to be delayed, is still being processed, hence no response
prepared yet, so the delayed response should be dropped on the stage of
the new response preparing. Otherwise in this place the old delayed
response will trigger BUG_ON().



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6456 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-07-31 01:09:58 +00:00
Vladislav Bolkhovitin
1656efe689 iscsi-scst: small post-r6315 cleanup
Avoid that rd_task declared when it is not used



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6408 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-07-03 04:21:52 +00:00
Bart Van Assche
79c8bf1f7c iscsi-scst, isert-scst: One trace flags variable per kernel module
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6397 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-23 15:01:17 +00:00
Bart Van Assche
46915ef3e5 iscsi-scst: Fix a syntax error
Preprocessor directives are not allowed in argument lists of a macro.
This patch reverts r6317.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6393 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-17 05:00:20 +00:00
Bart Van Assche
f272064c12 iscsi-scst: Suppress put_page_callback patch warnings
The put_page_callback patch only improves performance on single
socket systems but not on systems with multiple CPU sockets.
Since this message is confusing to SCST users, do not print a
warning if the put_page_callback patch has not been applied.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6340 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-16 23:10:28 +00:00
Vladislav Bolkhovitin
3e9eaf6b29 iscsi-scst: small post-r6315 cleanup
Avoid that rd_task when it is not used



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6317 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-16 01:43:26 +00:00
Bart Van Assche
0d9d6a6f57 isert-scst: Fix in-tree build
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6312 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-12 16:15:45 +00:00
Bart Van Assche
6aaeca1cd9 Merge iser branch r6234 into trunk
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6235 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-06-10 15:35:26 +00:00
Vladislav Bolkhovitin
1e78126962 iscsi-scst: update for 3.19 kernels
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> with some improvements



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6187 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-04-24 02:54:52 +00:00
Vladislav Bolkhovitin
5cc7555cd9 iscsi-scst: Rework sparse annotations
Do not declare kernel pointers as __user but instead cast these to
__user just before assigning these to iov_base.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6156 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-26 00:33:45 +00:00
Vladislav Bolkhovitin
fe38e4acb2 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-19 00:01:03 +00:00
Vladislav Bolkhovitin
4ac6d7a26d [PATCH] scst: Drop detect() method
There is no need for a detect() method - code that is present in such
a method can be moved to module_init(). Hence declare this method
obsolete. Leave the detect pointer member in the target template for
now for out-of-tree SCST drivers.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>

with some improvements



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6113 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-21 04:32:36 +00:00
Bart Van Assche
9707f85c0b Fix kernel 3.17 checkpatch warnings about 'long long unsigned'
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
2014-11-26 08:16:44 +00:00