8786 Commits

Author SHA1 Message Date
Vladislav Bolkhovitin
b4ba1b24c7 iscsi-scst: fix offset calculation
Fixed a subtle bug in iSCSI-SCST with incorrectly calculated offsets
for non-page aligned transfers. Originally discovered, investigated and
fix suggested by Кирилл Тюшев, then Shahar Salzman tested and proved it.
See http://sourceforge.net/mailarchive/message.php?msg_id=31924078



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5281 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-13 04:02:56 +00:00
Yan Burman
2b778b99ff isert: iscsi-scstd: Take into account con_blocking parameter when accepting iSER connection the same as in TCP code
Signed-off-by: Yan Burman <yanb@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5280 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-11 08:55:54 +00:00
Yan Burman
3d3f5250ce iscsi-scstd: No need to cal set_non_blocking() twice on the same fd during accept.
set_non_blocking() is being called in alloc_and_init_conn(), so no need to call it again later

Signed-off-by: Yan Burman <yanb@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5279 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-11 08:55:49 +00:00
Yan Burman
d81f105ebb isert: iscsi-scstd: Make sure we do not leak any resources on failure during accept
Signed-off-by: Yan Burman <yanb@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5278 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-11 08:55:42 +00:00
Bart Van Assche
4177cd82a6 scst_debug.h: Avoid that the sBUG() and sBUG_ON() definitions confuse the smatch static code checker
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5277 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-09 16:50:10 +00:00
Bart Van Assche
72968c9c15 scst: Build fix for kernel versions before 2.6.37
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5276 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-08 08:24:28 +00:00
Vladislav Bolkhovitin
634c1e69aa Fix spurious BUG when parse_type != SCST_USER_PARSE_STANDARD
Changeset 4224 introduced EXTRACHECKS for valid lba/data_len and state
at the end of the parsing phase of command processing.
However, the checks do not account for deferral of parsing to userland,
as occurs when SCST_USER_PARSE_CALL or SCST_USER_PARSE_EXCEPTION are specified.
In such cases the checks report errors on commands that userland has not yet
had an opportunity to parse.

NOTE: this includes a refactoring of the EXTRACHECKS to improve clarity.
      The rework is not exactly equivalent to the original code, but does
      conform to the comments describing the original code.
      Specifically, the original code would not trap an illegal command state
      unless there was also an illegal lba or data_len.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
with some improvements



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5275 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-08 01:52:03 +00:00
Vladislav Bolkhovitin
4d0fb300fe scst_user: Convert sgv_purge_interval to jiffies before use
The sgv_purge_interval from userland is passed down without conversion to
jiffies. Yet, if it is zero, the default value is (60 * HZ).
Convert to jiffies before passing down.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5274 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-08 01:04:27 +00:00
Bart Van Assche
07dbfb28a6 scst_vdisk: Build fix for kernels 2.6.27..2.6.30
add_to_page_cache_lru and __lock_page_killable are exported since
kernel version 2.6.30. See also patch "Staging: pohmelfs: kconfig/makefile
and vfs changes" (commit 18bc0bbd162e3eb3e7ea2953c315ad4113a57164;
included in kernel v2.6.30). 

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5273 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-07 12:46:39 +00:00
Bart Van Assche
91d9391194 scst_user, rt: Wake command processing thread when needed
In a fully-preemptible realtime kernel (CONFIG_PREEMPT_RT_FULL=y),
SCSI commands from an initiator time out because the userland target
application is never woken to process them.

This is because in a fully-preemptible realtime kernel, soft-IRQ
(tasklet) execution always occurs in a ksoftirqd thread and
preempt_count is not manipulated on soft-IRQ processing entry/exit.
This makes in_interrupt() useless for determining whether soft-IRQ
processing is occurring; instead, in_serving_softirq() should be
used for that purpose.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
[bvanassche: Elaborated source code comment]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5272 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-07 12:43:25 +00:00
Bart Van Assche
ad681d7c5a nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5271 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-07 08:11:28 +00:00
Bart Van Assche
1a367a14c8 regression tests: Run the 2.6.26..2.6.32 tests on the sysfs code instead of procfs
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5270 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-07 07:45:15 +00:00
Bart Van Assche
987f9bd776 scst_sysfs: Fix a build failure on kernels 2.6.2[678]
The sysfs API is supported from kernel 2.6.26 on and uses the swap()
macro while the swap() macro was introduced in kernel 2.6.29. Hence
provide a definition of the swap() macro for kernels before 2.6.29.

Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
[bvanassche: Moved swap() definition a few lines down and added #ifndef/#endif]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5269 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-07 07:31:38 +00:00
Bart Van Assche
59f48c1f33 ib_srpt: Avoid that disabling a target triggers a race condition
Avoid that disabling a target triggers a race condition with
SRP relogin. At least in theory this race condition could result
in a kernel crash.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5268 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-06 14:17:49 +00:00
Bart Van Assche
0a47e2e1ff qla2x00t: Re-sync help text with the code
The ql2xfdmienable module parameter defaults to 1, but the help text
claims it defaults to zero.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5267 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-06 13:38:28 +00:00
Bart Van Assche
022a8a6847 Hush Coverity warning of scst_ws_push_single_write() uninitialized pointer
Coverity warns that sgv may be used uninitialized. The warning
applies to WRITE SAME commands with LBDATA == PBDATA == 0 (replicate
a single block of user data into the specified LBA range).

The warning appears to be spurious - when LBDATA == PBDATA == 0,
scst_ws_write_cmd_finished() will not use the uninitialized value
saved by scst_ws_push_single_write().

Move initialization of sgv earlier in the function to quiesce the warning.

Signed-off-by: Steven J. Magnani <steve@digidescorp.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5266 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-06 13:30:06 +00:00
Bart Van Assche
cf699a6d95 scst_local: Fix a kernel oops for kernel versions < 2.6.37
Avoid that scst_local triggers "BUG: unable to handle kernel NULL
pointer dereference" on kernel versions before 2.6.37. This patch
fixes a regression introduced via patch "scst_local: Avoid
deadlock during module removal with kernel 3.6" (trunk r4566).

Reported-by: Sebastian Herbszt <herbszt@gmx.de>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5264 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-06 12:46:51 +00:00
Yan Burman
9869d54f64 isert: Update TODO
Signed-off-by: Yan Burman <yanb@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5263 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-04 11:46:52 +00:00
Yan Burman
ea47bb189c isert: Improve rdma_accept failure handling
If rdma_accept fails, use the cleanup mechanism we already have
for disconnect, instead of trying to reproduce the same cleanup.
From upper layer it really does not matter if rdma_accept failed
or we received disconnect immediately after rdma_accept succeeded.

Signed-off-by: Yan Burman <yanb@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5262 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-04 07:19:09 +00:00
Yan Burman
bde39e463e isert: Fix smatch issues
Signed-off-by: Yan Burman <yanb@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5261 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-04 07:03:04 +00:00
Bart Van Assche
be9a78a844 scripts/list-source-files: Handle Mercurial subdirectories properly
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5260 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-03 09:03:03 +00:00
Yan Burman
4375a5f59e isert: Update OFED compilation instructions for advanced users
Signed-off-by: Yan Burman <yanb@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5259 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-02 14:58:39 +00:00
Yan Burman
1978c7a7ed isert: Do not call rdma_destroy_qp() when there is isert_conn_qp_destroy()
Signed-off-by: Yan Burman <yanb@mellanox.com>

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5258 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-02 14:58:34 +00:00
Bart Van Assche
cf03aae45e scst: Build fix for Debian GNU/Linux 6.0
Avoid that building the iscsi-scst target driver fails as follows:

iscsi-scst/kernel/isert-scst/iser_rdma.c: In function 'isert_portal_listen':
iscsi-scst/kernel/isert-scst/iser_rdma.c:1450: error: implicit declaration of function 'pr_warn'


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5257 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-31 08:26:39 +00:00
Vladislav Bolkhovitin
d61106a512 scst_vdisk: Sort "add_device_parameters" alphabetically
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5256 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-31 02:35:20 +00:00
Vladislav Bolkhovitin
4cd021ae86 scst_vdisk: Check that "filename" is specified at most once
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5255 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-31 02:33:11 +00:00
Vladislav Bolkhovitin
bd53fcd860 scst_pres: Simplify PR locking
Since the time during which a PR read or write lock is held is short,
use a mutex to implement PR read and write locking. So although this
patch excludes multiple simultaneous readers that shouldn't affect the
time needed to process a PR operation measurably.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5254 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-31 02:32:02 +00:00
Bart Van Assche
41597bc469 nightly build: Add kernel version 3.13.1
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5253 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-30 09:31:32 +00:00
Bart Van Assche
777aee43d5 scripts/kernel-functions: Add a bug fix for the kernel 3.13 series that is not yet present in the kernel 3.13 stable series
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5252 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-30 09:30:18 +00:00
Bart Van Assche
7f1c22cbee nightly build: Add kernel 3.13 build infrastructure
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5251 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-30 09:16:27 +00:00
Vladislav Bolkhovitin
e6fd59bda4 Update for 3.13 kernels
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5250 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-30 02:32:44 +00:00
Vladislav Bolkhovitin
927748befa [PATCH 2/2] scst_sysfs: Add I/O statistics per target
Although it is possible to obtain these statistics by iterating over
all sessions and by computing the sum of the per-target statistics,
make per-target statistics directly available such that these can be
retrieved easily.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5249 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-30 01:41:54 +00:00
Vladislav Bolkhovitin
c905b530b7 [PATCH 1/2] scst_sysfs: Make it easier to add new target sysfs attributes
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@5248 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-30 01:40:48 +00:00
Vladislav Bolkhovitin
e9ef3fa2d1 Better version of the previous patch
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5247 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-29 04:16:58 +00:00
Vladislav Bolkhovitin
b0a7ab2210 Put CDB control byte parsing in one place
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5246 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-29 03:30:24 +00:00
Vladislav Bolkhovitin
91e6f7d26a iser: Make struct iscsit_transport a little bit more CPU cache friendly by combining fast path callbacks in a single cache line.
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5245 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-29 00:18:04 +00:00
Vladislav Bolkhovitin
f7915d582b Some more cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5244 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-29 00:07:14 +00:00
Vladislav Bolkhovitin
da19cd6ecc Small cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5243 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 22:07:45 +00:00
Vladislav Bolkhovitin
77fb4660a5 Initialized merge tracking via "svnmerge" with revisions "1-5241" from trunk
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5242 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 21:24:53 +00:00
Vladislav Bolkhovitin
00851a7501 Merge of adding iSER web page and copyright updates from the iSER branch
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5241 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 05:17:26 +00:00
Vladislav Bolkhovitin
9effb7ffc5 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5240 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 05:12:15 +00:00
Vladislav Bolkhovitin
42f648fcbc Web copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5239 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 04:56:36 +00:00
Vladislav Bolkhovitin
d567113d12 iSER target page added
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5238 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 04:52:39 +00:00
Vladislav Bolkhovitin
d3d69d4c89 [PATCH 9/9] scst: Add iSER module to RPM build
Signed-off-by: Yan Burman <yanb@mellanox.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5237 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 04:20:52 +00:00
Vladislav Bolkhovitin
623cbff5a3 [PATCH 8/9] scstadmin: Load isert-scst if iscsi is present
Signed-off-by: Yan Burman <yanb@mellanox.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5236 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 04:20:03 +00:00
Vladislav Bolkhovitin
c03bd27bca [PATCH 7/9] iscsid: Implement iser support
Add iser character device handling for accepting and handling connections
received through RDMA transport.
Add isert_listener device to the poll() loop and handle incoming
connection requests.

Differentiate between iser and non iser connections
Validate RDMAExtension field and reject it if found in iscsi login request.
Also, disable immediate data and first burst for iSER since it is not supported yet

Signed-off-by: Yan Burman <yanb@mellanox.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5235 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 04:19:27 +00:00
Vladislav Bolkhovitin
bded9b5943 [PATCH 6/9] iscsid: Refactor code for iser reuse
Refactor character device handling code as well as
connection allocation code in order to be able to reuse that in iser later on.

Signed-off-by: Yan Burman <yanb@mellanox.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5234 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 04:18:35 +00:00
Vladislav Bolkhovitin
39d0b2983a [PATCH 5/9] iscsid: Add start/stop transmit abstraction
In order to be able to abstract from socket and iser connection fd's
we need to have generic code that can handle both.

Signed-off-by: Yan Burman <yanb@mellanox.com>




git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5233 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 04:17:32 +00:00
Vladislav Bolkhovitin
5357b4c37d [PATCH 4/9] isert: Add initial isert code
Initial iSER code which also supports MLNX_OFED on RedHat and Ubuntu
as well as regular OFED

Signed-off-by: Yan Burman <yanb@mellanox.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5232 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 04:16:47 +00:00
Vladislav Bolkhovitin
de70fa73d9 [PATCH 3/9] iscsi: Export some functions needed by isert and refactor code for reuse
Refactor code to reuse iscsi command init in isert
Refactor conn allocation code to be able to reuse it in isert

Signed-off-by: Yan Burman <yanb@mellanox.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/iser@5231 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 04:15:16 +00:00