Commit Graph
2540 Commits
Author SHA1 Message Date
Bart Van Assche 4933f27d8d scst: Make scst/include/backport.h again compatible with MOFED
Fix the following build failure on RHEL 7 + MOFED 5.0:

In file included from <command-line>:0:0:
/usr/src/ofa_kernel/default/include/linux/compat-2.6.h:40:29: warning: "__GCC4_has_attribute___fallthrough__" is not defined [-Wundef]
 # define __has_attribute(x) __GCC4_has_attribute_##x
                             ^
/usr/src/packages/BUILD/scst-3.5.0.7946/iscsi-scst/kernel/isert-scst/../../../scst/include/backport.h:250:5: note: in expansion of macro '__has_attribute'
 #if __has_attribute(__fallthrough__)

Reported-by: Chesnokov Gleb <Chesnokov.G@raidix.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9163 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-09-16 02:59:28 +00:00
Bart Van Assche 9d9ae0f153 scst: Restore compatibility with gcc 4.x (RHEL 7.x)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9161 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-09-15 03:44:03 +00:00
Bart Van Assche 85fed6fa4a scst: Restore compatibility with RHEL 6.x
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9160 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-09-15 03:43:05 +00:00
Bart Van Assche ad546b1e68 scst: Add support for wildcard matching to the copy manager
Reported-by: L <514005989@qq.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9150 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-09-05 04:21:56 +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 ac08491d6a scst/include/backport.h: Backport the fallthrough macro
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9147 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-29 16:11:31 +00:00
Bart Van Assche 15033c44c6 scst: Fix the RHEL 6 / 7 kernel_write() backport
This patch unbreaks persistent reservation support.

Fixes: 94018a42e3 ("scst: Use kernel_{read,write}() instead of scst_{read,write}()")
Reported-by: Gleb Chesnokov <Chesnokov.G@raidix.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9121 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-28 04:16:28 +00:00
Bart Van Assche d333ce8232 Restore the on_alua_state_change_*() callback functions
Apparently the bind_alua_state functionality is being used. Hence restore
the on_alua_state_change_*() callback functions. The changes compared to
the previous implementation are:
* Only invoke the on_alua_state_change_*() callback functions if the state
  of a local target port group is being modified.
* Report information about ALUA callback activity with PRINT_INFO() instead
  of TRACE_MGMT_DBG().

This patch reverts commit 29548a4ad7 ("scst: Remove the
on_alua_state_change_*() callback functions").


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9120 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-10 00:31:42 +00:00
Bart Van Assche e0c63c52e7 scst: Introduce the function __scst_tgt_set_state()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9119 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-10 00:29:09 +00:00
Bart Van Assche 6616eb6cf7 scst_copy_mgr: Suppress a Coverity taint complaint
Suppress the following (false positive) Coverity complaint:

    CID 361193:  Insecure data handling  (TAINTED_SCALAR)
    Passing tainted variable "sense_len" to a tainted sink.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9118 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-09 00:42:32 +00:00
Bart Van Assche 6138af9193 scst_pres: Fix a potential buffer overflow in tid_secure()
This was detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9115 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-09 00:40:40 +00:00
Bart Van Assche 534f63f47b scst_pres: Use {get,put}_unaligned_be64() instead of {get,put}_unaligned_be()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9114 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-09 00:37:56 +00:00
Bart Van Assche 754f932d5d scst: Revert r9108
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9109 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-08 15:22:23 +00:00
Bart Van Assche 048ddfc638 scst_lib: Fix two lockdep_assert_held() statements
Fixes: 628f3939bc ("scst: Rework SCSI pass-through support for kernel versions >= 2.6.30") # r5979.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9108 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-08 15:17:09 +00:00
Bart Van Assche 2bafc3bd51 scst: Fix three potential integer overflows
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9103 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-03 03:29:33 +00:00
Bart Van Assche b1331f9a90 qla2x00t-32gbit: Fix the RHEL / CentOS 8.2 build
This patch has been tested against kernel version 4.18.0-193.14.2.el8_2.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9094 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 21:54:29 +00:00
Bart Van Assche ecea60a694 Make it possible to build SCST with clang
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9089 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-08-02 21:19:24 +00:00
Bart Van Assche 454c3fb81f Fix the qla2x00t-32gbit build on CentOS 8.2
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9087 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-29 01:59:10 +00:00
Bart Van Assche ebb024ff68 scst/include/backport.h: Backport qla2x00t-32gbit to older kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9084 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-26 23:51:54 +00:00
Bart Van Assche 7b375842e9 qla2x00t-32gbit: Fix two recently introduced build errors
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9074 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-25 14:45:27 +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 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 cf909e3e16 Makefiles: If both KDIR and KVER have been set, preserve KDIR
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9052 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-19 00:00:49 +00:00
Bart Van Assche c5ff6adeae Fix unloading of scst_vdisk while I/O is ongoing
Call scst_free_device() directly instead of when the final dev->refcnt
put happens. Call scst_assign_dev_handler(dev, &scst_null_devtype) after
processing of I/O commands for 'dev' has finished. Hold the RCU read lock
while invoking percpu_ref_get(&dev->refcnt) in the LUN translation code.
This patch fixes the following crash when scst_vdisk is unloaded while I/O
is ongoing:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000368
IP: [<ffffffffc09a80b3>] blockio_exec+0x43/0x250 [scst_vdisk]
 [<ffffffffc14fea1b>] scst_do_real_exec+0x5b/0x240 [scst]
 [<ffffffffc150172f>] scst_exec_check_blocking+0x12f/0x250 [scst]
 [<ffffffffc1503791>] scst_process_active_cmd+0x91/0x1640 [scst]

Fixes: 3f2d50b589 ("scst: Do not suspend command processing when deleting a device")
Reported-by: Rongqing Tu <rongqing.tu@hpe.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9048 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-12 23:35:03 +00:00
Bart Van Assche 34de8cd104 scst: Introduce a local variable
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9047 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-12 23:32:00 +00:00
Bart Van Assche fd059b135f Fix handling of MODE SENSE commands in scst_pre_dev_done()
Report the "write protect" flag correctly for read-only devices.

Reported-by: Krzysztof Rusek <rusek@9livesdata.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9043 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-08 14:15:20 +00:00
Bart Van Assche 4b5d66239e scst/include/backport.h: Improve the percpu-refcount backport further
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9042 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-05 02:26:59 +00:00
Bart Van Assche d6fd03107f Split Makefiles: move kernel build rules into Kbuild files
This patch makes the Makefiles easier to read.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9039 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-05 02:13:40 +00:00
Bart Van Assche 47403656ee Make 'make clean' remove all build files
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9038 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-05 02:08:55 +00:00
Bart Van Assche 2650ab25f9 scst/include/backport.h: Fix the network namespace backport
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9036 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-07-05 02:02:38 +00:00
Bart Van Assche bb43fbc468 scst/src/Makefile: Run /usr/sbin/weak-modules --remove-kernel before install
Apparently RHEL 8 / CentOS 8 create soft links in the weak-modules to SCST
directory but do not update these links correctly after having upgraded to
a newer kernel version and after having reinstalled SCST. Hence remove all
weak module links before installing SCST.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9033 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-21 16:31:59 +00:00
Bart Van Assche a79655c1eb scst/include/backport.h: Improve kobj_ns_grab_current() backport
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9032 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-21 16:28:01 +00:00
Bart Van Assche f8ea030ee1 scst/include/backport.h: Backport more percpu_ref functionality
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9031 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-21 16:27:28 +00:00
Bart Van Assche 7ecad01e71 scst, percpu_ref backport: For older kernels, use atomic instead of atomic_long
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9030 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-21 16:27:05 +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 de023fe1fe scst/include/backport.h: Fix the build against CentOS 8.2
See also https://github.com/bvanassche/scst/issues/25.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9024 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-16 17:39:35 +00:00
Bart Van Assche c91dbe8c60 scst: Fix the ARM build
When compiling SCST for an ARM CPU then do_div() checks whether its first
argument has type u64. Make sure that this is the case.

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


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@9006 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-10 02:37:18 +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 f7fe23928f Change $(MODULE_SYMVERS) into Module.symvers
Or in other words, drop support for kernel versions before 2.6.18.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8998 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:11:16 +00:00
Bart Van Assche e05b550817 scst/include/backport.h: Improve the FC_PORTSPEED_64GBIT backport
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8996 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:06:05 +00:00
Bart Van Assche 5aeb06e3a8 scst/include/backport.h: Improve the cpu_to_be32_array() backport
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8995 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:05:35 +00:00
Bart Van Assche 7e12731282 scst/include/backport.h: Improve the MIN_NICE backport
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8994 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-06-01 02:04:44 +00:00
Bart Van Assche 4458868846 scst_user: Fix a 32-bit compiler warning
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8989 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-31 03:28:33 +00:00
Bart Van Assche 3612dfb616 scst: Remove an unused macro
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8985 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-26 18:24:32 +00:00
Bart Van Assche 4b9e849cef scst: Adjust indentation to keep checkpatch happy
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8984 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-26 18:18:30 +00:00
Bart Van Assche 6077ad2b7b scst/include/backport.h: Backport the MIN_NICE definition
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8979 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 23:48:56 +00:00
Bart Van Assche 8a393a319b scst: Port to Linux kernel v5.8
Flag RQF_COPY_USER has been removed from kernel v5.8. Since that flag
only controls padding that we don't need, do not set that flag. See also
Linux kernel commit f18573abcc57 ("block: move the padding adjustment to
blk_rq_map_sg") # v2.6.26.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8955 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-23 17:24:09 +00:00
Bart Van Assche fd66fe5ea4 scst, device handlers: Fix gcc 10 compiler warnings
Instead of passing an scst_data_direction value to scst_scsi_execute(), pass
a dma_data_direction value.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8948 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2020-05-21 16:48:53 +00:00