Commit Graph

599 Commits

Author SHA1 Message Date
Bart Van Assche
bd16fd94de iscsid: Logically and negative conditions instead of or-ing these
Logically and negative allowed_portal conditions instead of
or-ing these. If both positive and negative conditions match,
the negative condition takes precedence.

This was proposed by Sergej Roytman <spocks.goatee@gmail.com>.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-24 09:03:04 +02:00
Bart Van Assche
a8a2725815 iscsi-scst: Add put_page_callback patch for kernel 3.19
Tested against the virtio_net network driver.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-13 18:44:00 +02:00
Bart Van Assche
904b3c1eb3 iscsi-scst: Kernel 3.19 build fix
Change the data type of iscsi_conn.read_iov into struct kvec * and
switch from iscsi_conn.read_size to iscsi_conn.read_msg.count for
kernel version 3.19 and later. Cast the return type of
get_zeroed_page() to void * since with this patch the read_iov
data type depends on the kernel version. Remove the (void __force
__user *) casts when assigning to iov_base since for a kvec iov_base
is a kernel pointer instead of a user space pointer. Switch to
iov_iter_kvec() to initialize conn->read_msg.msg_iter.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-13 18:44:00 +02:00
Bart Van Assche
02c014bf90 iscsi-scst: Prepare for kernel 3.19
Rework the iSCSI target driver code such that it becomes easier
to port this code to kernel 3.19.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-13 18:44:00 +02:00
Bart Van Assche
e860c56bcd iscsi-scst: Suppress put_page_callback patch warnings
The put_page_callback patch only improves performance on single-socket
systems but not on systems with multiple CPU sockets. Hence do not
print a warning if the put_page_callback patch has not been applied.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-13 18:44:00 +02:00
Bart Van Assche
c32f79f6c1 Revert T10-PI support
The T10-PI patch (r6162) increases the time needed to run mkfs.ext4
over iSCSI from less than a second to several minutes. This is a
regression so revert the T10-PI patch until there is sufficient time
to find the root cause of this regression and to fix this regression.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6171 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-31 09:51:24 +00:00
Bart Van Assche
6349372255 iscsi-scst: Switch to the new and preferred approach for printing kernel messages
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6163 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-29 17:28:38 +00:00
Vladislav Bolkhovitin
57ae9291b9 iscsi-scst: Concatenate two string literals
This patch fixes the following kernel 3.19 checkpatch complaint:

Consecutive strings are generally better as a single string.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6160 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-27 03:52:37 +00:00
Vladislav Bolkhovitin
5cc7555cd9 iscsi-scst: Rework sparse annotations
Do not declare kernel pointers as __user but instead cast these to
__user just before assigning these to iov_base.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6156 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-26 00:33:45 +00:00
Vladislav Bolkhovitin
fe38e4acb2 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-19 00:01:03 +00:00
Bart Van Assche
d9c1ffa29a iscsi-scst/usr/Makefile: Fix include path
Use the SCST_INC_DIR variable passed by the parent Makefile such that
both the in-tree and out-of-tree builds work.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6130 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-24 14:10:54 +00:00
Vladislav Bolkhovitin
4ac6d7a26d [PATCH] scst: Drop detect() method
There is no need for a detect() method - code that is present in such
a method can be moved to module_init(). Hence declare this method
obsolete. Leave the detect pointer member in the target template for
now for out-of-tree SCST drivers.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>

with some improvements



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6113 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-21 04:32:36 +00:00
Bart Van Assche
5019ae319e scst: Introduce file_inode()
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
[bvanassche: Constified file_inode() argument / added iscsi-scst conversion]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6084 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-12 07:48:10 +00:00
Bart Van Assche
628f3939bc scst: Rework SCSI pass-through support for kernel versions >= 2.6.30
Changes in this patch:
- Rework the SCSI pass-through code such that for kernel versions
  >= 2.6.30 the scst_exec_req_fifo patch is no longer needed.
- Modify the pass-through code such that blk_rq_append_bio() is only
  called for kernel version 2.6.30. For later kernel versions
  blk_make_request() is called instead.
- Rework scst_scsi_exec_async().
- Add debug tracing of SCSI pass-through result status.
- Add a lockdep_assert_held() call in scsi_end_async().



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5979 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-20 15:04:23 +00:00
Bart Van Assche
9cd602de2f Update for kernel 3.18
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5955 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 13:10:41 +00:00
Bart Van Assche
d8ec3a3873 Source code spelling fix: authentification -> authentication
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5946 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:31:08 +00:00
Bart Van Assche
c8d86e2811 Source code spelling fix: accesss -> access
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5944 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:28:56 +00:00
Bart Van Assche
8d518d8e33 iscsi-scst/kernel/patches/rhel/put_page_callback-2.6.32-504.patch: Add
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5904 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-03 17:06:57 +00:00
Bart Van Assche
9707f85c0b Fix kernel 3.17 checkpatch warnings about 'long long unsigned'
Avoid that checkpatch reports the following warning:

WARNING: type 'long long unsigned' should be specified in 'unsigned long long' order.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5885 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-11-26 08:16:44 +00:00
Vladislav Bolkhovitin
e13aa6622d Update for kernels 3.17.x
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5882 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-11-26 07:02:17 +00:00
Vladislav Bolkhovitin
d698f6c1bd Report RX data digest failures by default
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5856 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-11-15 01:55:27 +00:00
Bart Van Assche
23bfab0626 iscsi-scst: Make iscsi_thread_pool locking more fine-grained
Protect iscsi_thread_pool.threads_list via tp_mutex instead of
scst_mutex.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5852 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-10-18 08:56:23 +00:00
Vladislav Bolkhovitin
827e5b1461 scst, iscsi-scst: Add thread_pid attribute
For SCST devices with a short name determining which SCST command
threads serve a given LUN requires an (expensive) walk of the
process table. For SCST devices with a long name it is not possible
to determine unambiguously which command threads serve a given
LUN. Hence add a thread_pid sysfs attribute that makes it easy to
figure out which command threads serve a LUN.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5851 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-10-17 02:35:01 +00:00
Vladislav Bolkhovitin
9c2fb52429 iscsi-scst: Micro-optimize cmnd_prepare_recv_pdu()
Instead of adding sg[idx].offset to addr and immediately subtracting
sg[idx].offset again, leave out both arithmetic operations.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5735 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-08-27 02:55:28 +00:00
Vladislav Bolkhovitin
760b71423a scst: Remove set_cpus_allowed() invocations
Since scst.h contains a backport of the definition of set_cpus_allowed_ptr(),
the set_cpus_allowed() invocations are superfluous. Hence remove these.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5734 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-08-27 02:43:50 +00:00
Vladislav Bolkhovitin
87c6bba994 iscsi-scst: Build fix for IPV6=n
Ensure that iscsi-scst builds properly against a kernel with CONFIG_IPV6=n.

Reported by Igor Novgorodov <igor@novg.net> on June 7, 2014.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5732 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-08-27 02:41:40 +00:00
Bart Van Assche
a2b88e7894 Fix a kernel 3.16 checkpatch complaint about trailing semicolons
Avoid that the checkpatch tool included in Linux kernel v3.16 reports the
following warning:

    macros should not use a trailing semicolon

This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5724 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-08-22 07:19:55 +00:00
Vladislav Bolkhovitin
d45aab69a9 Fix incorrect address computation during receive PDUs preparations
Found and fix suggested by Кирилл Тюшев <kirill.tyushev8@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5721 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-08-21 05:17:47 +00:00
Vladislav Bolkhovitin
4d937c42ee Update for kernels 3.16
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5717 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-08-19 21:52:31 +00:00
Bart Van Assche
e4bcb3738d RHEL 7: Add scst_exec_req_fifo and put_page_callback patches
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5710 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-08-07 07:20:08 +00:00
Vladislav Bolkhovitin
726be64769 iscsi-scst: Handle data buffers with non-zero offset correctly
Start at the proper offset in the receive buffer if sg[0].offset != 0.
Return the proper data to the initiator if sg[0].offset != 0.

This patch reworks trunk r5281, "iscsi-scst: fix offset
calculation", February 13, 2014.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5683 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-07-19 03:54:33 +00:00
Vladislav Bolkhovitin
b6f2a47ee8 Change BUG_ON(1) into BUG()
With CONFIG_BUG=y both BUG() and BUG_ON(1) halt the system. However,
with CONFIG_BUG=n BUG() halts the system but BUG_ON(1) not. To avoid
such subtleties, change BUG_ON(1) into BUG().

See also patch Josh Triplett, "bug: Make BUG() always stop the machine",
7 April 2014 (commit ID a4b5d580e07875f9be29f62a57c67fbbdbb40ba2).

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5618 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-20 04:10:40 +00:00
Vladislav Bolkhovitin
6b32f4ae81 scst, iscsi-scst: Fix RHEL 5 compilation warnings
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5615 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-20 04:03:40 +00:00
Vladislav Bolkhovitin
c833137130 iscsi-scst: Suppress a compiler warning
Avoid that the following compiler warning is reported when compiling
iscsi-scst:

chap.c: In function 'chap_rand':
chap.c:348:5: warning: ignoring return value of 'read', declared with attribute warn_unused_result [-Wunused-result]
     (void)read(fd, &r, sizeof(r));
     ^

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5614 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-20 04:02:00 +00:00
Bart Van Assche
e902f79ecf kernel module installation: Skip "depmod" when building an RPM
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5612 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-19 12:48:25 +00:00
Vladislav Bolkhovitin
b5c649ef5c Update for 3.15 kernels
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5610 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-19 03:51:48 +00:00
Vladislav Bolkhovitin
523fe73096 Forgotten versions updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5597 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-13 05:03:17 +00:00
Vladislav Bolkhovitin
ca9b38693b scst: Switch from the cpu_*() to the cpumask_*() API
The cpus_*() functions were deprecated via patch "cpumask:
introduce new API, without changing anything" (November 2008,
commit ID 2d3854a37e8b). Hence switch from the cpus_*() API to
the cpumask_*() API.

This patch has the intended side effect of not adding the "[key]"
property to cpumask sysfs attributes that contain the default
cpumask. The current code namely reads uninitialized bits on
systems where nr_cpu_ids < NR_CPUS because cpus_equal() compares
more bits than those that were set by cpumask_copy().

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5596 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-13 04:52:18 +00:00
Vladislav Bolkhovitin
97167af582 scst: Make lockdep_assert_held() easier to use
The lockdep_assert_held() macro is a convenient debugging tool.
However, it is inconvenient to surround each invocation of that
macro by an #ifdef/#endif pair. Hence make it easier to use this
macro with older kernel versions.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5573 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-06 03:26:55 +00:00
Vladislav Bolkhovitin
6dab45204c scst: Leave out FSF mail address
This avoids that the following checkpatch complaint is triggered:

Do not include the paragraph about writing to the Free Software Foundation's
mailing address from the sample GPL notice. The FSF has changed addresses in
the past, and may do so again. Linux already includes a copy of the GPL.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5572 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-06 03:24:03 +00:00
Bart Van Assche
0880cbf0cf RHEL 7 build fixes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5543 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-05-23 07:33:53 +00:00
Vladislav Bolkhovitin
7d75a40089 Version changed to 3.1.0-pre1
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5536 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-05-22 03:06:46 +00:00
Vladislav Bolkhovitin
416958ee4b iscsi-scst: One major number per thread pool
Assign one major number per thread pool instead of as many major
numbers as there are threads in a thread pool. Do not increment
'major' if thread pool allocation fails. Micro-optimize
iscsi_threads_pool_get() by eliminating the assignment to 'fn'
and the write via snprintf() into name[].

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5520 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-05-15 01:39:12 +00:00
Vladislav Bolkhovitin
8d4a2f0a49 Cleanups and logging improvements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5503 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-05-06 23:22:32 +00:00
Bart Van Assche
cbc9df8306 iscsi-scst/kernel/patches/put_page_callback-3.2.57.patch: Add
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5450 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-20 06:24:23 +00:00
Bart Van Assche
135be0f19d iscsi-scst: Fix a checkpatch warning
Fix the following checkpatch 3.14 warning:

Unnecessary parentheses - maybe == should be = ?


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5435 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 05:56:35 +00:00
Vladislav Bolkhovitin
bbdf791c65 Update to kernels 3.14
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5432 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 00:32:51 +00:00
Vladislav Bolkhovitin
8599ec4452 Reimplement dropping of TM requests in a more reliable manner
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5395 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-26 23:51:36 +00:00
Vladislav Bolkhovitin
0c66b8aaf7 iscsi-scst: Introduce ARRAY_SIZE()
This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5386 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-26 03:21:25 +00:00
Bart Van Assche
cbb8071e73 put_page_callback-3.10.30.patch: Add
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5310 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-25 10:57:27 +00:00