Commit Graph

5781 Commits

Author SHA1 Message Date
Bart Van Assche
c63c44e4f0 vdisk_fileio: Add additioinal consistency check for asynchronous I/O
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7918 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-12 03:07:02 +00:00
Bart Van Assche
1f2e6e0113 qla2x00t: Fix an out of bounds access
Avoid that KASAN reports the following:

BUG: KASAN: stack-out-of-bounds in q2t_async_event+0x27c/0x3a0 [qla2x00tgt]
Read of size 2 at addr ffff8880db407db0 by task swapper/0/0

CPU: 0 PID: 0 Comm: swapper/0 Tainted: G           O      4.19.19-dbg+ #1
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Call Trace:
 <IRQ>
 dump_stack+0xa4/0xfa
 print_address_description+0x71/0x239
 kasan_report.cold.6+0x242/0x301
 __asan_load2+0x51/0x80
 q2t_async_event+0x27c/0x3a0 [qla2x00tgt]
 qla2x00_async_event+0x34f/0x2390 [qla2xxx_scst]
 qla24xx_msix_default+0x2b8/0x300 [qla2xxx_scst]
 __handle_irq_event_percpu+0x77/0x3c0
 handle_irq_event_percpu+0x68/0xe0
 handle_irq_event+0x5a/0x8b
 handle_edge_irq+0x114/0x2f0
 handle_irq+0x18d/0x205
 do_IRQ+0x73/0x150
 common_interrupt+0xf/0xf



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7917 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-11 00:11:01 +00:00
Bart Van Assche
42e88fc0ba scst: Use sg_virt() where appropriate
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7916 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-11 00:10:12 +00:00
Bart Van Assche
77d9c561d5 scst_pres: Avoid reading past the end of a buffer
Detected by smatch.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7915 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-11 00:09:33 +00:00
Bart Van Assche
e730c8cd58 scst_user: Introduce a helper function
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7914 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-11 00:08:28 +00:00
Bart Van Assche
3eb582b50e scst_sysfs: Fix a smatch warning
Avoid that smatch complains about using a variable before a NULL test.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7913 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-11 00:07:10 +00:00
Bart Van Assche
1ba9b34529 scst_vdisk: Add a consistency check
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7912 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-11 00:05:44 +00:00
Bart Van Assche
4d84d93d82 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7911 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-09 15:42:19 +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
685c3dfee3 scst: Avoid using 64-bit divisions on 32-bit systems
See also https://sourceforge.net/p/scst/tickets/17/.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7909 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-08 03:42:15 +00:00
Bart Van Assche
2d1a46182c scst: Fix the TRACE_EXIT_HRES() macro
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7908 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-08 03:40:56 +00:00
Bart Van Assche
2d5d0e978c scst_sysfs: Unbreak the 32-bit build
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7907 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-07 16:26:26 +00:00
Bart Van Assche
769599bda8 README: Add more detailed information about latency measurements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7906 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-07 04:01:29 +00:00
Bart Van Assche
814aed2eef README: Make instructions to retrieve latency information more generic
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7905 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-07 01:43:16 +00:00
Bart Van Assche
65cf98f90a scst_sysfs: Increase latency measurement suspend timeout from 1/HZ to 10 s
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7904 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-07 01:13:54 +00:00
Bart Van Assche
5981007af0 README: Document the latency measurement infrastructure
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7903 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-05 03:59:18 +00:00
Bart Van Assche
aebee8cb77 vdisk_blockio: Implement WRITE AND VERIFY
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7902 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-04 00:00:46 +00:00
Bart Van Assche
44505adfb2 scst_vdisk: Introduce vdev_verify()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7901 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-03 23:57:46 +00:00
Bart Van Assche
2c905c8f01 scst_vdisk: Simplify blockio_check_finish()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7900 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-03 23:56:52 +00:00
Bart Van Assche
b7fc7a25c6 scst_lib: Also check 'fs' for older kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7892 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 21:38:51 +00:00
Bart Van Assche
b588f90ccb scst: Disable the kernel_write() backport for RHEL 7
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7891 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 21:37:40 +00:00
Bart Van Assche
ae0037f88c ib_srpt: Fix the build against kernel version v2.6.30
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7882 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 21:14:12 +00:00
Bart Van Assche
9a36a84c0e scst/include/backport.h: Suppress a compiler warning
Avoid that building SCST with gcc version 8 or later againstkernel v4.14 or
before triggers a compiler warning about casting a function pointer to an
incompatible type.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7881 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 21:13:28 +00:00
Bart Van Assche
497fb8b9f2 scst: Backport kernel_read() to kernel versions before v4.14
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7880 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 21:11:54 +00:00
Bart Van Assche
1497af694b scst_vdisk: Fix the build for old kernel versions (v2.6.x)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7879 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 21:11:22 +00:00
Bart Van Assche
26c47ffc4e scst: Provide a definition for bdev_io_opt() for kernel versions < v2.6.32
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7878 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 21:10:46 +00:00
Bart Van Assche
0f0131a73d scst: Backport scst_blk_rq_cpu() to kernel versions before v2.6.28
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7877 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 21:10:13 +00:00
Bart Van Assche
c3ed16a8ef scripts/run-regression-tests: Print an error message if downloading a kernel tar ball failed
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7876 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 21:09:32 +00:00
Bart Van Assche
f86eb16a75 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7875 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 20:10:47 +00:00
Bart Van Assche
0f40b6fb0f nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7874 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 20:06:31 +00:00
Bart Van Assche
b6d08e5807 scst: Complain loudly if 'fs' is incorrect
Since not setting the fs register correctly leads to silent data
corruption, if scst_read(), scst_write(), scst_readv() or scst_writev()
is called, complain loudly if 'fs' has not been set correctly.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7873 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 19:43:31 +00:00
Bart Van Assche
4515746ea2 scst_dlm: Fix scst_read_file()
The 'fs' register must be set before vfs_read() is called. kernel_read()
does this but scst_read() not. Hence change the scst_read() call in the
dlm code into a kernel_read() call.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7872 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-13 19:41:42 +00:00
Bart Van Assche
cc9872d553 scst_dlm: Refuse to proceed if parsing the DLM node IDs failed
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7869 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-12 05:01:03 +00:00
Bart Van Assche
7cfd592f54 scst_dlm: Change four EXTRACHECKS_BUG_ON() statements into WARN_ON_ONCE() statements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7868 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-10 04:06:11 +00:00
Bart Van Assche
d83a51cee3 scst: Remove an unused variable
This patch fixes a compiler warning that was introduced in r7861.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7867 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-07 04:29:32 +00:00
Bart Van Assche
3e64094b0c scst_sysfs: Do not suspend I/O for LUN management
Protect modifications of sess_tgt_dev_list with the new mutex
tgt_dev_list_mutex. Protect read-only accesses of this list via
RCU. Do no longer lock scst_mutex when invoking any of the
following functions:
* scst_queue_report_luns_changed_UA().
* scst_report_luns_changed_sess().
* scst_lookup_tgt_dev() when invoked outside of command context.
* scst_nexus_loss().
* scst_do_nexus_loss_sess().
* scst_abort_all_nexus_loss_sess().
* scst_do_nexus_loss_tgt().

That change makes it safe to remove a LUN from sess_tgt_dev_list
while I/O is in progress. Hence allow LUN management without
suspending I/O. When removing a LUN, the LUN visibility changes
immediately without suspending I/O but the corresponding
scst_tgt_dev structures are only freed after a RCU grace period.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7866 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-05 22:32:45 +00:00
Bart Van Assche
941e324b99 scst_sysfs: Remove dead code
Detected by Coverity.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7865 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-05 22:20:01 +00:00
Bart Van Assche
e11462039a scst_lib: Remove two comment blocks and a trace statement
Remove the comment blocks from scst_block_generic_dev_done()
and scst_tape_generic_dev_done() since that comment does
not apply to these functions. Remove the trace statement from
scst_block_generic_dev_done() since it prints values that
are not modified by this function.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7864 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-05 22:18:14 +00:00
Bart Van Assche
1c6a617d51 scst_lib: Also intercept READ CAPACITY(16)
The scst_block_generic_dev_done() function parses the READ CAPACITY
response. Add support for parsing the READ CAPACITY(16) response.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7863 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-05 22:12:35 +00:00
Bart Van Assche
a77563897a scst: Avoid that a high I/O load prevents activity to be suspended
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7862 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-05 21:56:37 +00:00
Bart Van Assche
656931dfce scst_lib: Fix SCSI pass-through error handling
Some but not all SCSI LLD drivers set req->errors. Some SCSI
LLD drivers set req->errors to a negative Unix error code and
others assign the result of make_status_bytes() to req->errors.
The SCSI core finishes failed pass-through requests by calling
blk_finish_request(). That function calls req->end_io() without
setting req->errors. Hence check both the error argument and
req->errors before calling sioc->done().



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7861 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-05 21:55:26 +00:00
Bart Van Assche
457d6fceed scst, scst_vdisk: Simplify the code for querying the vdisk filename
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7860 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-05 21:42:33 +00:00
Bart Van Assche
f59534735d scst_vdisk: Make optimal transfer length parameter configurable
In testing SCST performance with MD RAID arrays for the backing device,
and RHEL 7.x initiators generating I/O, with the current optimal transfer
length (512 KiB) that SCST provides initiators (via the block limits VPD
page), it was observed on the target side that partial stripe writes were
occurring, even though at the file system layer full stripe writes were
being generated. Through testing it was determined the "optimal_io_size"
sysfs attribute and/or optimal transfer length data in the VPD page were
being utilized to fragment I/O on the initiator side.

While using the value of "optimal_io_size" from the MD RAID device (via
sysfs) stops partial stripe writes, it was observed additional throughput
can be gained by doubling/tripling/quadrupling this value. And it was
also observed that different values were preferred for writes vs. reads
to yield best performance.

The default value is 512 KiB (524288 bytes).

Signed-off-by: Marc Smith <marc.smith@parodyne.com>
[bvanassche: Made opt_trans_len attribute read/write]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7856 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-01-03 02:28:19 +00:00
Bart Van Assche
9a0c18aa1c scst: Disable I/O context sharing for kernel v4.21 and later kernels
Since kernel v4.21 no longer exports get_task_io_context() and
put_io_context() it is no longer possible to share I/O contexts on
kernel v4.21. Hence disable I/O context sharing for kernel >= v4.21.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7855 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-12-31 19:12:26 +00:00
Bart Van Assche
434207ab53 ib_srpt: Restore immediate data support
This implementation conforms to the SRP2 standard and hence is compatible
with the immediate data implementation in the Linux kernel v4.21 SRP initiator.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7854 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-12-31 19:10:24 +00:00
Bart Van Assche
e170b8dabc ib_srpt: Port to Linux kernel v4.21
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7853 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-12-31 19:06:37 +00:00
Bart Van Assche
0a2b30f4c9 ib_srpt: Remove support for immediate data
Remove the non-standard support for immediate data from the ib_srpt driver.
This will make porting this driver to kernel v4.21 easier.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7852 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-12-31 19:05:41 +00:00
Bart Van Assche
d3e2f5ab99 Makefiles: Stop using $(SUBDIRS)
This patch avoids that the following warning is reported when building
against kernel v4.21:

================= WARNING ================
'SUBDIRS' will be removed after Linux 5.3
Please use 'M=' or 'KBUILD_EXTMOD' instead
==========================================


A quote from an upstream kernel patch:

commit 07e5823127155b3a29003aca926f87c9843f6810
Author: Andrew Morton <akpm@osdl.org>
Date:   Mon Apr 12 01:05:40 2004 -0700

    [PATCH] kbuild: external module support
    
    From: Sam Ravnborg <sam@ravnborg.org>
    
    Based on initial patch from Andreas Gruenbacher there is now better support
    for building external modules with kbuild.
    
    The preferred syntax is now:
    make -C $KERNELSRC M=$PWD
    
    but the old syntax:
    make -C $KERNELSRC SUBDIRS=$PWD modules
    will remain supported.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7851 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-12-31 19:03:14 +00:00
Bart Van Assche
71c637eec1 debian/control: Add psmisc to the list of dependencies
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7850 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-12-31 18:57:30 +00:00
Bart Van Assche
43c6e39d3a scst: Port to Linux kernel v4.21
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7849 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2018-12-31 18:56:29 +00:00