Commit Graph

4585 Commits

Author SHA1 Message Date
Bart Van Assche
2fc0a18eb8 fcst: Display RXID in SCST error messages
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-30 09:00:18 +02:00
Bart Van Assche
487e7937b7 nightly build: Update kernel versions
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-30 08:59:13 +02:00
Bart Van Assche
def17abd22 fileio: Remove dead code
There is no FUA bit in WRITE VERIFY commands. Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-29 16:56:11 +02:00
Bart Van Assche
adaed5fdaa scst_local: Fix scst_local_add_target() error path
Do not return a pointer to freed memory in *out_tgt. Detected by
Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-29 16:56:11 +02:00
Bart Van Assche
d553113656 scst_local: Correct error handling in scst_local_sysfs_mgmt_cmd()
Avoid that __scst_local_add_adapter() failures are ignored.
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-29 16:56:11 +02:00
Bart Van Assche
dde37ec6ae scst: Remove dead code from scst_assign_dev_handler()
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-29 16:56:11 +02:00
Bart Van Assche
dff213dc8e scst_debug(): Avoid that debug_print_with_prefix() overflows the output buffer
Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-29 15:43:04 +02:00
Bart Van Assche
0da80bb241 scst_vdisk: Fix error handling in __vdev_load_mode_pages()
Avoid that unknown parameters cause __vdev_load_mode_pages() to
return 0 instead of -EINVAL. Detected by Coverity.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-29 15:42:22 +02:00
Bart Van Assche
24b317946b scripts/rebuild-rhel-kernel-rpm: Add RHEL 7.1 support
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-24 12:29:33 +02:00
Bart Van Assche
76be413535 RHEL 7.1: Add put_page_callback patch
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-24 12:29:31 +02:00
Bart Van Assche
1798aeb121 vdisk_blockio: Set REQ_WRITE flag before invoking bio_add_page()
The bio request type must be set before bio_add_page() is invoked.
See e.g. raid5_mergeable_bvec() for an example of a function that
checks (bi_rw & REQ_WRITE) from inside the bio_add_page() call.
This patch improves performance when using SCST on top of RAID5.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-24 09:03:04 +02:00
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
a15628d683 scst_lib: Improve WRITE SAME performance
Some storage devices have a block size of 512 bytes and a minimum
I/O size and/or optimal I/O size of 4096 bytes. Improve WRITE SAME
performance for such devices by increasing the I/O granularity from
512 bytes to 4096 bytes.

Based on a patch written by Vishal Tripathi <vishal.tripathi@calsoftinc.com>
and Sushil Sharma <sushil.sharma@calsoftinc.com>.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-22 14:29:18 +02:00
Bart Van Assche
fef85147ce nightly build: Update kernel versions
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-21 10:59:23 +02:00
Bart Van Assche
33a782e549 scst_targ: Also intercept READ CAPACITY(16)
The scst_block_generic_dev_done() function parses the READ CAPACITY
response. Add support for parsing the READ CAPACITY(16) response.
Additionally, add a check whether the response buffer is big enough
to hold the sector size.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-16 10:48:10 +02:00
Bart Van Assche
acacb09327 scst_targ: Avoid incorrect block size changes
The scst_block_generic_dev_done() function parses the READ CAPACITY
response without checking whether the response buffer contains
valid data. This can lead to incorrect block size changes and also
to the following kernel warning:

WARNING: at scst/src/scst_lib.c:7353 scst_calc_block_shift+0x7f/0xb0 [scst]()
1 << 23 != 12595456
 [<ffffffff816071e3>] dump_stack+0x19/0x1b
 [<ffffffff8106e23d>] warn_slowpath_common+0x7d/0xc0
 [<ffffffff8106e336>] warn_slowpath_fmt+0x46/0x50
 [<ffffffffa0712e2f>] scst_calc_block_shift+0x7f/0xb0 [scst]
 [<ffffffffa072dbd7>] scst_block_generic_dev_done.part.39+0x6a/0x7d [scst]
 [<ffffffffa07162a4>] scst_block_generic_dev_done+0x34/0x40 [scst]
 [<ffffffffa0066205>] dev_user_disk_done+0x15/0x20 [scst_user]
 [<ffffffffa070c119>] scst_dev_done+0x49/0x150 [scst]
 [<ffffffffa070e1a0>] scst_process_active_cmd+0x240/0x390 [scst]
 [<ffffffffa070e7e1>] scst_process_redirect_cmd+0x121/0x1e0 [scst]
 [<ffffffffa070e916>] scst_cmd_done_local+0x76/0x120 [scst]
 [<ffffffffa006843a>] dev_user_process_reply_exec+0x8a/0x370 [scst_user]
 [<ffffffffa00699e2>] dev_user_process_reply+0x242/0x2e0 [scst_user]
 [<ffffffffa0069b80>] dev_user_reply_get_cmd.isra.17+0x100/0x2d0 [scst_user]
 [<ffffffffa0069ea7>] dev_user_ioctl+0x157/0x428 [scst_user]
 [<ffffffff811d999a>] do_vfs_ioctl+0x7a/0x2e0
 [<ffffffff811d9c91>] SyS_ioctl+0x91/0xb0
 [<ffffffff8161b269>] system_call_fastpath+0x16/0x1b

Avoid this by calling dev_done() handlers only for completed commands
and not for aborted commands.

Reported-by: Gal Rosen <galr@storone.com>
Reported-by: Abacus Liang <abacusl@hotmail.com>
Reported-by: Shahar Salzman <shahar.salzman@kaminario.com>
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-16 10:00:20 +02:00
Bart Van Assche
85a3c5691d scst_lib: Remove two comment blocks and a trace statement
Remove the comment blocks from scst_block_generic_dev_done()
and scst_tape_generic_dev_done() since that comment does
not apply to these functions. Remove the trace statement from
scst_block_generic_dev_done() since it prints values that
are not modified by this function.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-16 09:36:17 +02:00
Bart Van Assche
9d3a3caaa9 scst: Log block size changes
A block size change is a very important change so log such
changes.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-16 09:36:17 +02:00
Bart Van Assche
8a23c532be scst: Rename SERVICE_ACTION_IN into SERVICE_ACTION_IN_16
Rename this constant because it has been renamed in the Linux
kernel.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-16 09:36:17 +02:00
Bart Van Assche
8c6d767193 scst_lib: Fix SCSI pass-through error handling
Some but not all SCSI LLD drivers set req->errors. Some SCSI
LLD drivers set req->errors to a negative Unix error code and
others assign the result of make_status_bytes() to req->errors.
The SCSI core finishes failed pass-through requests by calling
blk_finish_request(). That function calls req->end_io() without
setting req->errors. Hence check both the error argument and
req->errors before calling sioc->done().

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-16 09:36:09 +02:00
Bart Van Assche
5b57a0bcea ib_srpt: RHEL 5 build fix
Make the ib_srpt driver build again on RHEL 5 systems. See also
r6138 / commit ID 940faa9ad4.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-15 17:54:56 +02:00
Bart Van Assche
36ffdf330b scst_local: RHEL 5 build fix
Add a definition of scsi_bidi_cmnd() for older kernel versions.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-15 17:54:56 +02:00
Bart Van Assche
6e0fdac887 scst: RHEL 5 build fix for file_inode()
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-15 17:54:56 +02:00
Bart Van Assche
d7f4189bae nightly build: Add kernel versions 3.19 and 4.0
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-15 14:30:34 +02:00
Bart Van Assche
14b014edf2 nightly build: Add kernel 4.0 build infrastructure
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-15 14:30:34 +02:00
Bart Van Assche
36c09aafb1 scripts/kernel-functions: Port to kernel v4.x
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-15 14:30:34 +02:00
Bart Van Assche
cfe7b53ad3 qla2x00t: Port to RHEL 6
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.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-15 14:30:34 +02:00
Bart Van Assche
a613f706c3 ib_srpt: RHEL 7.1 build fix
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.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-15 14:30:34 +02:00
Bart Van Assche
2d467580d1 scst: Remove unreachable code
Code after BUG() is unreachable both with CONFIG_BUG=y and with
CONFIG_BUG=n. Hence remove such code. Detected by smatch.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-15 14:30:34 +02:00
Bart Van Assche
bf9d2668a5 scst: Fix WRITE SAME parsing
* scst_lib: refuse WRITE SAME commands with UNMAP=0 and ANCHOR=1 or
  with UNMAP=0 and no data buffer. SBC-4 requires to respond with
  "ILLEGAL REQUEST / INVALID FIELD IN CDB" to such WRITE SAME commands.
* scst_lib: use the WRITE SAME(16) NODB bit to determine the data
  buffer length.
* scst_vdisk: test for the ANCHOR bit via mask 0x10 instead of mask 0x01.
* scst_vdisk: print an error message if a WRITE SAME command has been
  refused because of an unusual value of NUMBER OF LOGICAL BLOCKS.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-15 14:30:34 +02:00
Bart Van Assche
6c46b1a5a0 scst: Remove the dev_unregistering member variable
This variable is no longer needed because devices are
removed from the devices list via list_del_init() before
being unregistered. See also trunk r5510 / commit f3820d5bc4.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-15 14:30:34 +02:00
Bart Van Assche
32cadc07df scst: Rework the code for waiting until an I/O context is ready
Introduce a wait event and eliminate the msleep() call that is
used for waiting until an I/O context is ready.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-15 14:30:31 +02:00
Bart Van Assche
6317a4a5ee qla2x00t: Kernel 3.19 build fix
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-13 18:44:00 +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
2d97fce7de vdisk_blockio: Make the WRITE VERIFY warning less verbose
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-13 18:44:00 +02:00
Bart Van Assche
c380042f9f Remove SourceForge www directory 2015-04-13 16:22:43 +02:00
Bart Van Assche
b470b861c9 Add .gitignore
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
2015-04-13 16:22:43 +02:00
Bart Van Assche
33a4bccc38 ib_srpt: Avoid that aborting a command triggers a race condition
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6181 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-04-10 05:39:44 +00:00
Vladislav Bolkhovitin
268c7ce246 Docs update
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6180 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-04-10 00:33:05 +00:00
Bart Van Assche
98fb52432c ib_srpt: Specify a valid completion vector during completion queue creation
Avoid that SRP login can fail as follows:

kernel: ib_srpt: failed to create CQ: cqe 320; c.v. 17; ret -22


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6179 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-04-09 15:06:36 +00:00
Bart Van Assche
8cb332836f scripts/specialize-patch: Fix a bug in evaluate()
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6176 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-04-01 07:17:17 +00:00
Bart Van Assche
b0167433fb qla2x00t: Fix spelling in a source code comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6175 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-04-01 06:39:16 +00:00
Bart Van Assche
356c46e018 qla2x00t: Avoid that checkpatch complains about indentation
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6174 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-04-01 06:37:50 +00: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
01524f59ce qla2x00t: Fix a checkpatch complaint about whitespace
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6170 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-31 07:58:48 +00:00
Bart Van Assche
2dc5f994cf scst.h: Address recently introduced checkpatch complaints about whitespace
Address the following checkpatch complaints:

ERROR:POINTER_LOCATION: "foo * bar" should be "foo *bar"
ERROR:SPACING: space required before the open parenthesis '('


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6169 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-30 14:56:42 +00:00
Bart Van Assche
4751a5bf5d scst_vdisk: Fix indentation
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6168 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-30 14:46:00 +00:00