Commit Graph

5827 Commits

Author SHA1 Message Date
Bart Van Assche
0cbfed3042 scst_vdisk: Avoid duplicating the add_device parameters
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7965 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 22:28:25 +00:00
Bart Van Assche
f570994000 scst: Change add_device_parameters from a string into an array
This patch does not change any functionality.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7964 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 22:27:04 +00:00
Bart Van Assche
9649e0af96 scst_vdisk: Add a comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7963 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 22:21:23 +00:00
Bart Van Assche
5dfaf65dfc scst_vdisk: Make the 'async' attribute modifiable
Make it possible to change the 'async' attribute after a virtual disk
device has been created.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7962 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 22:20:58 +00:00
Bart Van Assche
589dad3997 scst: Rework the scst_data_direction enum
Since there is no relationship between enum dma_data_direction and the
SCST data direction enum, introduce a new enumeration type for the SCST
data direction. This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7961 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 22:18:06 +00:00
Bart Van Assche
281801a266 scstadmin: Make $Version a local variable
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7960 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:51:36 +00:00
Bart Van Assche
906c18ae83 scstadmin: Update copyright
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7959 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:49:44 +00:00
Bart Van Assche
3a87185399 scstadmin: Avoid triggering Perl warnings
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7958 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:45:42 +00:00
Bart Van Assche
4ed48121e3 scstadmin: Update expected output of test 07
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7957 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:40:37 +00:00
Bart Van Assche
1eae6633b4 scstadmin: Fix Perl warnings
Modify those constructs that trigger warnings with 'use warnings'. This
patch does not modify any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7956 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:38:14 +00:00
Bart Van Assche
9fb607fe12 scstadmin: Check $answer before using it
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7955 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:30:13 +00:00
Bart Van Assche
bf45a6162f scstadmin: Add a test that causes scstadmin to display a prompt
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7954 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 01:29:40 +00:00
Bart Van Assche
b79fa94a27 scstadmin: Initialize container variables explicitly
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7953 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 00:46:27 +00:00
Bart Van Assche
a1b1a880af scstadmin: Remove a superfluous declaration
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7952 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 00:41:48 +00:00
Bart Van Assche
bad428c615 scstadmin: Initialize container variables explicitly
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7951 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 00:40:23 +00:00
Bart Van Assche
c4cc4bdcbc scstadmin: Avoid dereferencing variables that have the value undef
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7950 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 00:38:50 +00:00
Bart Van Assche
27d90a3563 scstadmin: Improve the consistency of test 07
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7949 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 00:34:48 +00:00
Bart Van Assche
4f762acebd scstadmin: Set remote targets and remote rel_tgt_ids in test 07
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7948 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-18 00:34:03 +00:00
Bart Van Assche
f2b4c0d256 scstadmin: Restrict a source code line to 80 columns
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7947 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-17 22:08:58 +00:00
Bart Van Assche
2da0ddd47d scstadmin: Avoid passing 'undef' to chomp()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7946 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-17 22:07:35 +00:00
Bart Van Assche
477c49a7a6 scstadmin: Fix regression test 07
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7945 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-17 22:05:12 +00:00
Bart Van Assche
d5c1e5ba79 scstadmin: Use defined() instead of !... eq '' to check whether arguments have been specified
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7944 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-17 19:33:44 +00:00
Bart Van Assche
b75421e3ef scstadmin: Add a test for the messages printed for invalid args
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7943 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-17 19:29:46 +00:00
Bart Van Assche
b347e79a40 scstadmin: Fix an ALUA command line option error message
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7942 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-17 19:26:50 +00:00
Bart Van Assche
0c676b034d scstadmin: Avoid shadowing the errorString declaration, part 5
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7941 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 19:19:48 +00:00
Bart Van Assche
0f2dae492f scstadmin: Rearrange addVirtualTarget()
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7940 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 19:11:27 +00:00
Bart Van Assche
7d9212affb scstadmin: Avoid shadowing the errorString declaration, part 4
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7939 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 19:08:50 +00:00
Bart Van Assche
2b238a6abb scstadmin: Avoid shadowing the errorString declaration, part 3
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7938 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 19:03:39 +00:00
Bart Van Assche
6b566f8adf scstadmin: Avoid shadowing the errorString declaration, part 2
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7937 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 18:59:50 +00:00
Bart Van Assche
2a84df8445 scstadmin: Avoid shadowing the errorString declaration
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7936 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 18:44:33 +00:00
Bart Van Assche
b56d94a153 scstadmin: Make it easier to debug regression test 06
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7935 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 18:32:42 +00:00
Bart Van Assche
27893e7e58 scstadmin: Avoid shadowed declarations in test 03
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7934 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 18:31:19 +00:00
Bart Van Assche
1d85efa936 scstadmin: Improve handling of write-only ALUA attributes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7933 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 17:47:12 +00:00
Bart Van Assche
64b7f7057d scstadmin: Add tests for the scstadmin -list_* options
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7932 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 17:40:56 +00:00
Bart Van Assche
52f9a2b285 scstadmin: Improve test script robustness
Check the return value of most system() calls. Use gawk instead of awk
when using GNU extensions.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7931 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 17:37:12 +00:00
Bart Van Assche
b2119c2133 scstadmin: Sort output of -list_* options alphabetically
Making the output of these options predictable is necessary because
a later patch will add regression tests for the -list_* options.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7930 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 17:15:45 +00:00
Bart Van Assche
a645fe5294 scstadmin: Enable Perl warnings in tests scripts
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7929 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 17:13:50 +00:00
Bart Van Assche
e5d9a6869e scst_vdisk: Avoid that setting numa_node_id causes unloading scst_vdisk to hang
This patch fixes a bug that was introduced by r7075 / bdb23b89 ("scst:
performance improvements").

Reported-by: Marc Smith <marc.smith@parodyne.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7927 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-16 16:50:16 +00:00
Bart Van Assche
42b9143de6 vdisk_fileio: Fix handling of WRITE AND VERIFY if async = 1
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7926 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-13 06:26:23 +00:00
Bart Van Assche
b19c8f0428 scst_vdisk: Only execute commands with a data buffer asynchronously
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7925 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-13 06:20:26 +00:00
Bart Van Assche
81e904c750 scst: Rework scst_handle_aca()
Make sure that the code that is in the hot path occurs first.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7924 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-12 03:41:16 +00:00
Bart Van Assche
e2639613c5 scst: Introduce scst_handle_aca()
Move the ACA code out of __scst_init_cmd() to make __scst_init_cmd()
easier to read. This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7923 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-12 03:40:48 +00:00
Bart Van Assche
34f9b158e2 scst: Only switch to thread context if no Data-Out buffer and no failure
This patch avoids that the following is reported:

[0]: scst_pre_parse:949:Failed CDB:
 (h)___0__1__2__3__4__5__6__7__8__9__A__B__C__D__E__F
   0: 8b 00 00 00 00 00 00 00 00 00 00 00 00 01 00 00   ................
[0]: dev_vdisk: vdisk_parse_offset:2999:Unknown opcode 0x8b
[0]: scst_parse_cmd:1333:Atomic context and non-WRITE data direction, rescheduling (cmd 00000000cd981f2b)
[0]: scst: scst_process_active_cmd:5571:***CRITICAL ERROR***: cmd 00000000cd981f2b is in invalid state 10)
BUG at /home/bart/software/scst.git/scst/src/scst_targ.c:5572
 ------------[ cut here ]------------
DEBUG_LOCKS_WARN_ON(val > preempt_count())
WARNING: CPU: 1 PID: 0 at kernel/sched/core.c:3230 preempt_count_sub+0x7f/0xd0
Modules linked in: qla2x00tgt(O) scst_vdisk(O) isert_scst(O) iscsi_scst(O) scst(O) sd_mod sg brd dlm af_packet crct10dif_pclmul hid_generic aesni_intel aes_x86_64 crypto_simd cryptd usbhid glue_helper hid qla2xxx_scst(O) virtio_balloon l
CPU: 1 PID: 0 Comm: swapper/1 Tainted: G        W  O      5.0.0-rc6-dbg+ #2
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Call Trace:
 <IRQ>
 __local_bh_enable_ip+0x7e/0x140
 local_bh_enable+0x15/0x20 [scst]
 scst_process_active_cmd+0x555/0x570 [scst]
 scst_do_job_active.constprop.23+0x57/0xe0 [scst]
 scst_cmd_tasklet+0x42/0x70 [scst]
 tasklet_action_common.isra.14+0xc3/0x280
 tasklet_action+0x3d/0x50
 __do_softirq+0x12d/0x5b7
 irq_exit+0xdd/0x100
 do_IRQ+0xc3/0x160
 common_interrupt+0xf/0xf
 </IRQ>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7922 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-12 03:16:12 +00:00
Bart Van Assche
aa6c9558e8 scst: Introduce enum scst_exec_res
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7921 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-12 03:10:12 +00:00
Bart Van Assche
6dc08eb5b6 scst_vdisk: Avoid that fileio_alloc_and_parse() locks up in tasklet context if low on memory
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7920 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-12 03:08:39 +00:00
Bart Van Assche
70150cb912 scst: Remove the exec_sync flag
Since all device handlers have at least one asynchronous mode, remove
the exec_sync flag.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7919 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-02-12 03:07:54 +00:00
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