Commit Graph

7226 Commits

Author SHA1 Message Date
Bart Van Assche
5fc080dddd Restore www directory 2019-09-14 18:12:01 -07:00
Bart Van Assche
e16e4dbc21 Merge branch 'svn-trunk' 2019-09-14 17:30:08 -07:00
Bart Van Assche
f6371c5d5e Makefiles: Run depmod also on Ubuntu systems after module installation
Fixes: e902f79ecf ("kernel module installation: Skip "depmod" when building an RPM"; r5612)



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8582 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-15 00:29:55 +00:00
Bart Van Assche
4ca22bd4e6 Merge branch 'svn-trunk' 2019-09-12 18:37:10 -07:00
Bart Van Assche
feff5380c8 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8581 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-13 01:36:58 +00:00
Bart Van Assche
196fba4dc4 Merge branch 'svn-trunk' 2019-09-06 21:02:30 -07:00
Bart Van Assche
0ce7c75782 qla2x00t-32gbit/qla2x00-target/README: Update this file
Bring this README file in sync with the recently checked in changes.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8580 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-07 03:58:30 +00:00
Bart Van Assche
35cd068962 scst_vdisk: Set REQ_PRIO for SCSI commands marked as head-of-queue
REQ_PRIO requests preempt others in the CFQ I/O scheduler. REQ_META marks
metadata requests for blktrace.

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


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8579 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-07 03:55:23 +00:00
Bart Van Assche
1821c5a2de scst/include/backport.h: Fix kvmalloc() backport for RHEL 7
The kvmalloc function was added in RHEL 7.5. So the backport is
needed for RHEL 7.4 and older. _COMPAT_LINUX_MM_H is checked as
well to avoid a conflict with the appropriate backport in MOFED.

Signed-off-by: Sergey Gorenko <sergeygo@mellanox.com>

[ bvanassche: fixed spelling in commit message ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8578 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-07 03:43:59 +00:00
Bart Van Assche
12e87680fd nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8577 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-07 01:45:44 +00:00
Bart Van Assche
cbce3d8fbb Merge branch 'svn-trunk' 2019-09-05 20:43:35 -07:00
Bart Van Assche
410c462405 scst_copy_mgr: Fix copy manager LUN wraparound
This patch has been provided by Alexander Sinditskiy. See also
https://sourceforge.net/p/scst/tickets/27/.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8575 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-09-06 03:38:38 +00:00
Bart Van Assche
cc5a257003 Merge branch 'svn-trunk' 2019-08-25 17:49:01 -07:00
Bart Van Assche
df08f74e7e qla2x00t-32gbit: Fix a format string in a debug message
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8574 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-26 00:48:03 +00:00
Bart Van Assche
cae4c3ce24 qla2x00t-32gbit: Use %<n>phC where appropriate.
This patch reverts commit d20be1897c ("qla2x00t-32gbit: Avoid using the
format specifier %*phC") / r8166.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8573 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-26 00:44:52 +00:00
Bart Van Assche
d17134bc20 qla2x00t-32gbit: Complain loudly if attempting to build against an unsupported kernel
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8572 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-26 00:26:42 +00:00
Bart Van Assche
9267f92ba5 scripts/generate-kernel-patch: Only select new QLogic driver for kernel versions >= 3.15
A recent change (.cmd_size in the SCSI host template) increased the
minimal kernel version required for qla2x00t-32gbit. Update
scripts/generate-kernel-patch.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8571 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-26 00:25:58 +00:00
Bart Van Assche
1d2a50ecaa scripts/run-regression-tests: Suppress several gcc 9 compiler warnings
Suppress several gcc 9 compiler warnings for kernel versions before v5.1.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8570 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-26 00:24:45 +00:00
Bart Van Assche
7a7f467adc qla2x00t-32gbit: Fix a race condition
This patch fixes the following kernel complaint:

WARNING: CPU: 7 PID: 16514 at kernel/workqueue.c:3031 __flush_work.cold+0x1f/0x29
Workqueue: qla2xxx_wq qla2x00_iocb_work_fn [qla2xxx_scst]
RIP: 0010:__flush_work.cold+0x1f/0x29
Call Trace:
 flush_work+0x14/0x20
 qla24xx_do_nack_work+0x84/0x150 [qla2xxx_scst]
 qla2x00_do_work+0x50b/0x17e0 [qla2xxx_scst]
 qla2x00_iocb_work_fn+0x96/0x100 [qla2xxx_scst]
 process_one_work+0x56d/0xac0
 worker_thread+0x7a/0x5d0
 kthread+0x1bc/0x210
 ret_from_fork+0x24/0x30



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8569 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-26 00:24:07 +00:00
Bart Van Assche
521c0261ec iscsi-scst/conftest/bad_wr_mod: Fix a Coverity complaint
Fix the following Coverity complaint:

CID 326815 (#1 of 1): Explicit null dereferenced (FORWARD_NULL)
2. var_deref_model: Passing null pointer qp to ib_post_recv, which dereferences it.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8568 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 22:55:48 +00:00
Bart Van Assche
59641c1d5f scst: Fix a memory leak
Fix the following Coverity complaint:

CID 344744 (#1 of 1): Resource leak (RESOURCE_LEAK)5. leaked_storage: Variable sioc going out of scope leaks the storage it points to.




git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8567 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 22:55:20 +00:00
Bart Van Assche
9e0914d470 scst_vdisk: Fix a Coverity complaint about integer overflow
Fix the following Coverity complaint:

CID 347914 (#1 of 1): Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN)overflow_before_widen: Potentially overflowing expression blocks << cmd->dev->block_shift - 9 with type uint32_t (32 bits, unsigned) is evaluated using 32-bit arithmetic, and then used in a context that expects an expression of type sector_t (64 bits, unsigned).
    
To avoid overflow, cast blocks to type sector_t.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8566 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 22:54:55 +00:00
Bart Van Assche
8f033f3f9d scst: Backport scsi_cmd_priv()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8565 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 22:54:15 +00:00
Bart Van Assche
c205138e87 scripts: Fix multiple shellcheck warnings
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8564 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 22:51:57 +00:00
Bart Van Assche
ee24c6bab2 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8563 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 14:02:33 +00:00
Bart Van Assche
839e365166 Merge branch 'svn-trunk' 2019-08-24 20:22:00 -07:00
Bart Van Assche
0dc0a43a08 qla2x00t-32gbit: Minimize diffs with trunk
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8562 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 03:21:06 +00:00
Bart Van Assche
7970005b40 qla2x00t-32gbit: Check sp->fcport->deleted again in qla2xxx_eh_abort()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8561 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 03:11:04 +00:00
Bart Van Assche
787bd29c97 qla2xxx: Fix a NULL pointer dereference
BUG: KASAN: null-ptr-deref in qla24xx_handle_plogi_done_event+0x134/0x9f0 [qla2xxx]
Read of size 4 at addr 00000000000000a0 by task swapper/2/0

CPU: 2 PID: 0 Comm: swapper/2 Not tainted 5.2.0-dbg+ #1
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
Call Trace:
 <IRQ>
 dump_stack+0x8a/0xd6
 __kasan_report.cold+0x5/0x41
 kasan_report+0x16/0x20
 __asan_load4+0x7e/0x80
 qla24xx_handle_plogi_done_event+0x134/0x9f0 [qla2xxx]
 qla2x00_els_dcmd2_sp_done+0x15f/0x230 [qla2xxx]
 qla24xx_els_ct_entry+0x3b3/0x610 [qla2xxx]
 qla24xx_process_response_queue+0x514/0x10e0 [qla2xxx]
 qla24xx_msix_rsp_q+0x80/0x100 [qla2xxx]
 __handle_irq_event_percpu+0x72/0x450
 handle_irq_event_percpu+0x74/0xf0
 handle_irq_event+0x5e/0x8f
 handle_edge_irq+0x13a/0x320
 handle_irq+0x30/0x40
 do_IRQ+0x91/0x190
 common_interrupt+0xf/0xf
 </IRQ>
RIP: 0010:default_idle+0x31/0x230

[ commit d1436e456b840162eb4d162f99055d2adb79a566 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8560 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 03:09:55 +00:00
Bart Van Assche
134a9fec1a qla2x00t-32gbit: Cleanup trace buffer initialization
Avoid code duplication between qla2x00_alloc_offload_mem() and
qla2x00_alloc_fw_dump() by moving the FCE and EFT buffer allocation and
initialization to separate functions. Cleanly track failure and success by
making sure that the ha->eft, ha->fce and respective eft_dma, fce_dma
members are set if and only if the buffers are properly allocated and
initialized. Avoid pointless buffer reallocation.  Eliminate some goto
statements. Make sure the fce_enabled flag is cleared when the FCE buffer
is freed.

[ commit 3cf92f4bfccbb3e378cd86dc46e09c2bc18cda26 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8559 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 03:08:18 +00:00
Bart Van Assche
51d92beed3 qla2x00t-32gbit: qla2x00_alloc_fw_dump: set ha->eft
In qla2x00_alloc_fw_dump(), an existing EFT buffer (e.g. from previous
invocation of qla2x00_alloc_offload_mem()) is freed.  The buffer is then
re-allocated, but without setting the eft and eft_dma fields to the new
values.

[ commit edbd56472a636ab396f5ee6783e8438fa725a6ee upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8558 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 03:07:02 +00:00
Bart Van Assche
b964872cb8 qla2x00t-32gbit: Fix hang in fcport delete path
A hang was observed in the fcport delete path when the device was
responding slow and an issue-lip path (results in session termination) was
taken.

Fix this by issuing logo requests unconditionally.

PID: 19491  TASK: ffff8e23e67bb150  CPU: 0   COMMAND: "kworker/0:0"
 #0 [ffff8e2370297bf8] __schedule at ffffffffb4f7dbb0
 #1 [ffff8e2370297c88] schedule at ffffffffb4f7e199
 #2 [ffff8e2370297c98] schedule_timeout at ffffffffb4f7ba68
 #3 [ffff8e2370297d40] msleep at ffffffffb48ad9ff
 #4 [ffff8e2370297d58] qlt_free_session_done at ffffffffc0c32052 [qla2xxx]
 #5 [ffff8e2370297e20] process_one_work at ffffffffb48bcfdf
 #6 [ffff8e2370297e68] worker_thread at ffffffffb48bdca6
 #7 [ffff8e2370297ec8] kthread at ffffffffb48c4f81

[ commit f00b3428a801 upstream ]



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8557 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 03:03:55 +00:00
Bart Van Assche
0baeaf170c qla2x00t-32gbit: Fix qla24xx_async_abort_cmd()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8556 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 03:02:56 +00:00
Bart Van Assche
a3c05add05 qla2x00t-32gbit: Make sure that aborted commands are freed
[ commit e43842016685a31d1a036891ffdbae647539aa27 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8555 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 03:02:27 +00:00
Bart Van Assche
d1367ce124 qla2x00t-32gbit: Fix two function headers
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8554 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 03:01:32 +00:00
Bart Van Assche
32aefe4307 qla2x00t-32gbit: Fix-up for r8552
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8553 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:45:48 +00:00
Bart Van Assche
a2cefa63a9 qla2x00t-32gbit: Inline the qla2x00_fcport_event_handler() function
Instead of calling qla2x00_fcport_event_handler() and letting the switch
statement inside that function decide which other function to call, call
the latter function directly. Remove the event member from the event_arg
structure because it is no longer needed. Remove the
qla_handle_els_plogi_done() function because it is never called.

[ commit 897def2004213636ffe2e9ee6a75660c5b53b03d upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8552 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:38:32 +00:00
Bart Van Assche
446ae45661 qla2x00t-32gbit: Report invalid mailbox status codes
It is easy to mix up the QLA_* and the MBS_* status codes. Complain loudly
if that happens.

[ commit 724361921f65a40ae5b80641dc1e92c0ff314d89 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8551 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:37:55 +00:00
Bart Van Assche
cddc0c892d qla2x00t-32gbit: Remove superfluous sts_entry_* casts
The C language supports implicit casting of void pointers to non-void
pointers. Remove explicit sts_entry_* casts that are not necessary.

[ commit 1a20719e074ada3e6d06ee065afd527779a6793b upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8550 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:37:29 +00:00
Bart Van Assche
f5a2e51016 qla2x00t-32gbit: Let the compiler check the type of the SCSI command context pointer
Split srb_cmd.ctx into two pointers such that the compiler can check the
type of that pointer.

[ commit 5ec9f9040f61dfd0412a53fa2fc1e321727a5a61 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8549 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:36:49 +00:00
Bart Van Assche
72cc459a40 qla2x00t-32gbit: Complain if sp->done() is not called from the completion path
Not calling sp->done() from the command completion path is a severe bug.
Hence complain loudly if that happens.

[ commit 88263208dd23327b56fbd7c2858c389c1153b366 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8548 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:36:13 +00:00
Bart Van Assche
1f88b95c15 qla2x00t-32gbit: Introduce qla2xxx_get_next_handle()
This patch reduces code duplication.
    
[ commit bcc856574356df2eb5eb2d4491e7205339e55728 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8547 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:35:42 +00:00
Bart Van Assche
bc7f5b55fb qla2x00t-32gbit: Fix a race condition between aborting and completing a SCSI command
Instead of allocating a struct srb dynamically from inside .queuecommand(),
set qla2xxx_driver_template.cmd_size such that struct scsi_cmnd and struct
srb are contiguous. Do not call QLA_QPAIR_MARK_BUSY() /
QLA_QPAIR_MARK_NOT_BUSY() for SRBs associated with SCSI commands. That is
safe because scsi_remove_host() is called before queue pairs are deleted
and scsi_remove_host() waits for all outstanding SCSI commands to finish.

[ commit 85cffefa09e448906a6f0bc20f422d75a18675bd upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8546 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:34:53 +00:00
Bart Van Assche
7d3e856e61 qla2x00t-32gbit: Introduce the function qla2xxx_init_sp()
This patch does not change any functionality but makes the next patch
easier to read.

[ commit bdb61b9b944d1e5b7cee5a9fe21014363c55b811 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8545 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:34:07 +00:00
Bart Van Assche
41d4d6316b qla2x00t-32gbit: Enable type checking for the SRB free and done callback functions
Since all pointers passed to the srb_t.done() and srb_t.free() functions
have type srb_t, change the type of the first argument of these functions
from void * into struct srb *. This allows the compiler to verify the
argument types for these functions. This patch does not change any
functionality.

[ commit 6c18a43e3c82b0b67531a1cdec7ba31540fe6424 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8544 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:33:13 +00:00
Bart Van Assche
dc61adfa3a qla2x00t-32gbit: Use be_id_t etc. in more code
[ commit df95f39ae76474d922d9be9c0260dc263c451b09 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8543 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:31:44 +00:00
Bart Van Assche
790661121f qla2x00t-32gbit: Use strlcpy() instead of strncpy()
[ commit cc74049f35e8 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8542 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:25:18 +00:00
Bart Van Assche
6ee78e839e qla2x00t-32gbit: Suppress a recently introduced kernel warning
Fixes: 6ab417a5ef ("qla2x00t-32gbit: Always check the qla2x00_wait_for_hba_online() return value").



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8541 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:20:58 +00:00
Bart Van Assche
0ff3d58d02 qla2x00t-32gbit: Use tabs instead of spaces for indentation
This patch only modifies whitespace.

[ commit 0184793df2e860534380a66aa76b8807e71188c2 upstream ]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8540 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:14:43 +00:00
Bart Van Assche
12ca81c338 qla2x00t-32gbit: Fix up a misapplied patch
Not sure why 'patch' misapplied a patch ...


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8539 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2019-08-25 02:09:18 +00:00