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>
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>
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>
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>
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>
* 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>
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>
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>
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>
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>
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>
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
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
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
Thanks to SanDisk and Emulex for supporting this work!
Tested with Emulex SDK Release 5.2.1
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6162 d57e44dd-8a1f-0410-8b47-8ef2f437770f