Commit Graph

596 Commits

Author SHA1 Message Date
Bart Van Assche
f58c8248dd iscst-scst: Fix the OFED build
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9083 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 03:34:55 +00:00
Bart Van Assche
bd3355500a iscsi-scst, srpt: Rename the PRE_CFLAGS variable into CONFTEST_FLAGS
The latter name reflects better the role of this variable. Remove the
CPPFLAGS assignment from srpt/src/Kbuild because it is not useful.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9082 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 03:34:35 +00:00
Bart Van Assche
203d427368 iscsi-scst/kernel/isert-scst/Kbuild: Revert r9075 because it triggers duplicate symbol warnings on x86
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9076 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 00:49:48 +00:00
Bart Van Assche
8a22ef6289 ib_srpt, iscsi-scst: Port to Linux kernel v5.8
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9060 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:09:23 +00:00
Bart Van Assche
64276e3dfb Rename the iSCSI kernel module Makefiles into Kbuild
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9059 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:04:21 +00:00
Bart Van Assche
a7446766c5 isert-scst Makefile: Add the SCST Module.symvers file
This patch fixes a linker error when cross-compiling for ARM on x86_64.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9055 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-19 01:19:49 +00:00
Bart Van Assche
7569ddaf2e Makefiles: Remove -Wextra
Since not all kernel header files are compatible with -Wextra, remove -Wextra.
To enable -Wextra, build SCST with W=1.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9054 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-19 01:18:24 +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
c51cf132e1 iscsi-scst: Add network namespace support
This patch makes it possible to run the SCST iSCSI target software inside
a Docker container that uses another network namespace than the default.
    
See also https://github.com/bvanassche/scst/issues/24 .


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9002 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-06 16:27:41 +00:00
Bart Van Assche
9be61ba538 Move KBUILD_EXTRA_SYMBOLS definitions into the kernel Makefiles
$(KBUILD_EXTRA_SYMBOLS) is not only used at compile time but also at link
time. Move the $(KBUILD_EXTRA_SYMBOLS) definitions such that it is
available both at compile time and at link time.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9000 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:15:47 +00:00
Bart Van Assche
80ac4d2810 Use $(src) instead of $(KBUILD_EXTMOD)
While $(src) is always defined, $(KBUILD_EXTMOD) is only defined when
building code as an external module.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8999 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:12:09 +00:00
Bart Van Assche
d12b0a0d91 Fix spelling in documentation and source code
See also https://github.com/bvanassche/scst/pull/20.

[ bvanassche: left out qla2x00t-32gbit changes and changed patch description ]



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8920 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-15 18:53:48 +00:00
Bart Van Assche
bcdfc28dd8 iscsi-scst: Add a hint what to look for if no userspace process is connected
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
[ bvanassche: edited description and patch ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8907 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-13 20:48:12 +00:00
Bart Van Assche
08ba5d8f1a iscsi-scst: Remove unnecessary %s format modifiers
See also https://github.com/bvanassche/scst/pull/18.

Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8903 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-12 14:57:00 +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
ecaab978f0 scst, scstadmin, ...: Bump the version number to 3.5.0-pre
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8683 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-06 05:28:56 +00:00
Bart Van Assche
fa156aa40d scripts/update-version: Fix the code for updating the scstadmin version number
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8681 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-04 05:00:49 +00:00
Bart Van Assche
09edff95e3 isert-scst: Bump the version number
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8677 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-12-04 04:54:05 +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
a50b32ca42 isert-scst: Change unlikely(IS_ERR(...)) into IS_ERR(...)
Surrounding IS_ERR(...) with unlikely() is redundant. Remove the redundant
unlikely() annotations.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8623 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-11-02 23:03:18 +00:00
Bart Van Assche
f623815252 isert-scst: Unbreak the build for kernel versions <= v4.8
Fixes: 36c0648b7e ("isert-scst: Fix the build against kernel v5.3") / r8475.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8482 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-25 04:32:38 +00:00
Bart Van Assche
36c0648b7e isert-scst: Fix the build against kernel v5.3
In kernel v5.3 the ib_destroy_cq() return type has been changed from 'int'
into 'void'.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8475 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-07-24 01:12:06 +00:00
Bart Van Assche
506aac2508 iscsi-scst: Detect at compile time whether or not max_recv_sge is available
Signed-off-by: Sergey Gorenko <sergeygo@mellanox.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8399 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-31 01:21:49 +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
22f1132073 Makefiles: Rework build mode switching
Move the build_mode file from the top level into the scst directory. Write
build mode defines into scst/include/build_mode.h and include that file
directly or indirectly in all source files that depend on these #defines.
This approach has the advantage that "make clean" does no longer has to
be run when switching between build modes because the kernel build system
recognizes build_mode.h as a dependency and triggers a rebuild of all
source files that directly or indirectly include the build_mode.h header
file.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8347 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-05-05 18:19:38 +00:00
Bart Van Assche
33f2f4a064 Makefiles: Only read the build_mode file if building inside the SCST tree
This patch avoids that the build_mode file is read when applying the
generate-kernel-patch output to the kernel tree and when building the
kernel tree.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8272 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-23 17:11:26 +00:00
Bart Van Assche
01e8d4aadd iscsi-scst, isert-scst: Make this driver build against RHEL 8
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8259 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-04-20 16:38:51 +00:00
Bart Van Assche
dc7e039124 Makefiles: Remove most instances of $(SCST_INC_DIR)
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
2019-03-25 22:10:21 +00:00
Bart Van Assche
70d3c72779 Makefiles: Use ccflags-y instead of EXTRA_CFLAGS
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8076 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-03-25 19:56:17 +00:00
Bart Van Assche
74e5b31b95 Makefiles: Use cc-option instead of enable-Wextra
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8075 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-03-25 19:55:15 +00:00
Bart Van Assche
623d4e6d0a Makefiles: Use build_mode instead of modifying the Makefile when switching the build mode
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8074 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-03-25 19:53:39 +00:00
Bart Van Assche
a94c8eaf0f scst: Move the set_fs() calls into scst_{read,write}v()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8066 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-03-21 02:56:46 +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
0655c3e76a iscsi-scst: Fix a use-after-free
Avoid that KASAN reports the following complaint:

BUG: KASAN: slab-out-of-bounds in f/0xdc4 [iscsi_scst]
Read of size 8 at addr ffff888be35fd0ec by task iscsiwr0_71/3289

CPU: 42 PID: 3289 Comm: iscsiwr0_71 Tainted: G
sos.debug #1
Hardware name: To be filled by O.E.M.
Call Trace:
 dump_stack+0x8e/0xc8
 print_address_description+0x73/0x238
 kasan_report+0x228/0x251
 check_memory_region+0x126/0x12c
 __asan_loadN+0xf/0x11
 write_data+0x5df/0xdc4 [iscsi_scst]
 iscsi_do_send+0x20/0x67 [iscsi_scst]
 iscsi_send+0x1f0/0x574 [iscsi_scst]
 scst_do_job_wr+0x2ef/0x549 [iscsi_scst]
 istwr+0x366/0x4a2 [iscsi_scst]
 kthread+0x1df/0x1ef
 ret_from_fork+0x3a/0x50

Allocated by task 3063:
 save_stack_trace+0x1b/0x1d
 kasan_kmalloc.part.1+0x62/0xee
 kasan_kmalloc+0x7f/0x8b
 kasan_slab_alloc+0x12/0x14
 kmem_cache_alloc+0x13d/0x27a
 mempool_alloc_slab+0x15/0x17
 mempool_alloc+0xdb/0x1f3
 scst_alloc_aen+0x96/0x223 [scst]
 scst_gen_aen_or_ua+0x16b/0x3d2 [scst]
 scst_capacity_data_changed+0x147/0x1cd [scst]
 vdev_size_process_store+0x1b5/0x1f4 [scst_vdisk]
 scst_process_sysfs_works+0x187/0x2a1 [scst]
 sysfs_work_thread_fn+0x301/0x42b [scst]
 kthread+0x1df/0x1ef
 ret_from_fork+0x3a/0x50

Reported-by: Marc Smith <msmith626@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8056 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-03-18 00:23:05 +00:00
Bart Van Assche
0a01b504e0 iscsi-isert: Avoid that reading the target_ip sysfs attribute triggers a kernel oops
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
2019-03-11 03:58:30 +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
c8d8d7fbbe isert-scst: Fix several checkpatch warnings
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8047 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-03-11 03:47:48 +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
9df67df132 iscsi-scst: Fix 32-bit compiler warnings
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7910 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-08 03:43:35 +00:00
Bart Van Assche
bf3f677040 isert-scst: Fix sparse warnings related to poll functions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7837 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-11-28 06:39:48 +00:00
Bart Van Assche
df02132689 iscsi-scst: Remove the no longer supported put_page_callback patches
See also trunk r7809.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7811 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-11-17 22:31:57 +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
78a0407d0e scst, iscsi-scst: Simplify the code that uses kstrto*l()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7522 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-10-14 22:05:33 +00:00
Bart Van Assche
93d7c0da08 Expand Kconfig help texts
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7518 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-10-14 21:59:08 +00:00
Bart Van Assche
c59b0a2303 iscsi-scst: Insert spaces after comma's where required according to the coding style
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7517 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-10-14 21:58:38 +00:00
Bart Van Assche
e2a17c6a24 Change 'long long int' int 'long long'
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7505 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-10-14 03:57:53 +00:00