kthread_stop() not only stops a thread but also frees the associated
task struct. Avoid that functions that iterate over the thread list
can encounter an invalid task structure pointer. This patch fixes the
following kernel crash:
general protection fault: 0000 [#2] PREEMPT SMP
RIP: 0010:[<ffffffff81080e9c>] [<ffffffff81080e9c>] __task_pid_nr_ns+0x9c/0x1b0
Call Trace:
[<ffffffffa045ed7d>] task_pid_vnr+0xd/0x10 [scst]
[<ffffffffa0460418>] scst_tgt_dev_thread_pid_show+0x78/0xd0 [scst]
[<ffffffffa045929f>] scst_show+0xf/0x20 [scst]
[<ffffffff81231acb>] sysfs_kf_seq_show+0xab/0x130
[<ffffffff81230176>] kernfs_seq_show+0x26/0x30
[<ffffffff811daf10>] seq_read+0xe0/0x3e0
[<ffffffff81230ab5>] kernfs_fop_read+0x125/0x180
[<ffffffff811b0138>] __vfs_read+0x28/0xe0
[<ffffffff811b07ca>] vfs_read+0x8a/0x140
[<ffffffff811b1669>] SyS_read+0x49/0xb0
[<ffffffff814ffd32>] system_call_fastpath+0x16/0x7a
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6359 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Use lockdep to verify that the caller holds scst_mutex if the
scst_mutex_held argument has not been set.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6357 d57e44dd-8a1f-0410-8b47-8ef2f437770f
scst_free_tgt_dev() frees the memory tgt_dev points at which means
that list_for_each_entry_safe() is needed here.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6356 d57e44dd-8a1f-0410-8b47-8ef2f437770f
If while attaching a pass-through device the READ CAPACITY command
reports an invalid sector size, log an error message.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6355 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Fix the argument of the second kunmap() call. Detected by smatch.
See also patch "scst_lib: Improve WRITE SAME performance" (commit
ID a15628d683). Note: this patch does not have any impact on
64-bit architectures since kunmap() doesn't to anything on such
architectures.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6350 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Add instructions for how to download and install the 16 Gb/s FC HBA
driver. Remove the "optional step" since this step should not be
needed after various recent fixes in the SCST makefiles. Recommend
to blacklist the distro QLA initiator driver even if the kernel is
not being rebuilt.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6349 d57e44dd-8a1f-0410-8b47-8ef2f437770f
If a data length mismatch has been detected, report the LBA and
the lengths that do not match.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6346 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The BUG_ON(handler == NULL) statement at the start of this function
guarantees that handler != NULL. Hence remove the remaining tests of
the 'handler' pointer. Detected by Coverity.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6341 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The put_page_callback patch only improves performance on single
socket systems but not on systems with multiple CPU sockets.
Since this message is confusing to SCST users, do not print a
warning if the put_page_callback patch has not been applied.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6340 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that unknown parameters cause __vdev_load_mode_pages() to
return 0 instead of -EINVAL. Detected by Coverity.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6338 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Although RHEL 6 is based on the 2.6.32 kernel, for RHEL 6.1 the
argument list for sysfs callback functions follows the style of
kernel 2.6.35.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6332 d57e44dd-8a1f-0410-8b47-8ef2f437770f
With the RHEL 7.0 kernel ib_register_mad_agent() takes eight
arguments. With the RHEL 7.1 kernel the same function takes nine
arguments. Detect at build time how many arguments this function
takes.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6331 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Code after BUG() is unreachable both with CONFIG_BUG=y and with
CONFIG_BUG=n. Hence remove such code. Detected by smatch.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6330 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Although the non-SRQ mode needs more resources that mode has the
advantage that the end-to-end flow control mechanism is used.
From the IB spec:
C9-150.2.1: For QPs that are not associated with an SRQ, each HCA
receive queue shall generate end-to-end flow control credits. If
a QP is associated with an SRQ, the HCA receive queue shall not
generate end-to-end flow control credits.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6329 d57e44dd-8a1f-0410-8b47-8ef2f437770f
It is annoying that some warnings are only reported in release mode.
Modify scst_debug.h such that the compiler does not report variables
that are only used in debug builds as unused.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6315 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that the compiler complains that the variable 'pad_bytes'
is not used with CONFIG_LIBCRC32C=n.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6314 d57e44dd-8a1f-0410-8b47-8ef2f437770f