Avoid that building SCST with gcc version 8 or later againstkernel v4.14 or
before triggers a compiler warning about casting a function pointer to an
incompatible type.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7881 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since not setting the fs register correctly leads to silent data
corruption, if scst_read(), scst_write(), scst_readv() or scst_writev()
is called, complain loudly if 'fs' has not been set correctly.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7873 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The 'fs' register must be set before vfs_read() is called. kernel_read()
does this but scst_read() not. Hence change the scst_read() call in the
dlm code into a kernel_read() call.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7872 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Protect modifications of sess_tgt_dev_list with the new mutex
tgt_dev_list_mutex. Protect read-only accesses of this list via
RCU. Do no longer lock scst_mutex when invoking any of the
following functions:
* scst_queue_report_luns_changed_UA().
* scst_report_luns_changed_sess().
* scst_lookup_tgt_dev() when invoked outside of command context.
* scst_nexus_loss().
* scst_do_nexus_loss_sess().
* scst_abort_all_nexus_loss_sess().
* scst_do_nexus_loss_tgt().
That change makes it safe to remove a LUN from sess_tgt_dev_list
while I/O is in progress. Hence allow LUN management without
suspending I/O. When removing a LUN, the LUN visibility changes
immediately without suspending I/O but the corresponding
scst_tgt_dev structures are only freed after a RCU grace period.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7866 d57e44dd-8a1f-0410-8b47-8ef2f437770f
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.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7864 d57e44dd-8a1f-0410-8b47-8ef2f437770f
The scst_block_generic_dev_done() function parses the READ CAPACITY
response. Add support for parsing the READ CAPACITY(16) response.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7863 d57e44dd-8a1f-0410-8b47-8ef2f437770f
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().
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7861 d57e44dd-8a1f-0410-8b47-8ef2f437770f
In testing SCST performance with MD RAID arrays for the backing device,
and RHEL 7.x initiators generating I/O, with the current optimal transfer
length (512 KiB) that SCST provides initiators (via the block limits VPD
page), it was observed on the target side that partial stripe writes were
occurring, even though at the file system layer full stripe writes were
being generated. Through testing it was determined the "optimal_io_size"
sysfs attribute and/or optimal transfer length data in the VPD page were
being utilized to fragment I/O on the initiator side.
While using the value of "optimal_io_size" from the MD RAID device (via
sysfs) stops partial stripe writes, it was observed additional throughput
can be gained by doubling/tripling/quadrupling this value. And it was
also observed that different values were preferred for writes vs. reads
to yield best performance.
The default value is 512 KiB (524288 bytes).
Signed-off-by: Marc Smith <marc.smith@parodyne.com>
[bvanassche: Made opt_trans_len attribute read/write]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7856 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Since kernel v4.21 no longer exports get_task_io_context() and
put_io_context() it is no longer possible to share I/O contexts on
kernel v4.21. Hence disable I/O context sharing for kernel >= v4.21.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7855 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This implementation conforms to the SRP2 standard and hence is compatible
with the immediate data implementation in the Linux kernel v4.21 SRP initiator.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7854 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Remove the non-standard support for immediate data from the ib_srpt driver.
This will make porting this driver to kernel v4.21 easier.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7852 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch avoids that the following warning is reported when building
against kernel v4.21:
================= WARNING ================
'SUBDIRS' will be removed after Linux 5.3
Please use 'M=' or 'KBUILD_EXTMOD' instead
==========================================
A quote from an upstream kernel patch:
commit 07e5823127155b3a29003aca926f87c9843f6810
Author: Andrew Morton <akpm@osdl.org>
Date: Mon Apr 12 01:05:40 2004 -0700
[PATCH] kbuild: external module support
From: Sam Ravnborg <sam@ravnborg.org>
Based on initial patch from Andreas Gruenbacher there is now better support
for building external modules with kbuild.
The preferred syntax is now:
make -C $KERNELSRC M=$PWD
but the old syntax:
make -C $KERNELSRC SUBDIRS=$PWD modules
will remain supported.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7851 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that the following is reported when compiling scst on RHEL 7.6:
scst/iscsi-scst/kernel/isert-scst/isert_login.c:843:11: error: 'EPOLLHUP' undeclared (first use in this function)
mask |= EPOLLHUP | EPOLLIN;
Signed-off-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7843 d57e44dd-8a1f-0410-8b47-8ef2f437770f
RHEL7.6 backported the WRITE_VERIFY_16 macro to their 3.10 based
kernel (3.10.0-957.*), so do not define WRITE_VERIFY_16 on RHEL7.6
and above.
Reported-by: Tomohiro Kusumi <kusumi.tomohiro@osnexus.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7842 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Except for adding a few pr_info() statements, this patch does not change any
functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7840 d57e44dd-8a1f-0410-8b47-8ef2f437770f
MBX_2 contains the number of bytes required for the buffer, but
qla2x00_mailbox_command() doesn't request MBX_2 from the firmware.
Signed-off-by: Anton Nefedov <anton.nefedov@virtuozzo.com>
[ bvanassche: edited commit message ]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@7839 d57e44dd-8a1f-0410-8b47-8ef2f437770f