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>
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
This version is production used by SanDisk for quite some time and
passed all very hard internal tests. However, due to original qla2xxx
issues NPIV is not working in this version, so if you need NPIV either
use v3.0 of this driver or the driver from the QLogic git.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6148 d57e44dd-8a1f-0410-8b47-8ef2f437770f
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
The QLogic firmware and qla2xxx do not register for RSCNs in
target-only mode, so do that explicitly.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5966 d57e44dd-8a1f-0410-8b47-8ef2f437770f
There seems to be a bug in passing sense information to QLA HBAs, where
the last 2 bytes of the sense data (ASC, ASCQ) are not copied to the low
level sense buffer.
We encountered this in ESX, which relies on these 2 bytes to parse the
MISCOMPARE sense code (0xE1, 0x1D, 0x00).
Bellow is a simple test to recreate this issue, but during vMotion
operations (where VMs are moved from one host to another), this may
cause the operation to fail leaving the VM in an inconsistent state.
The test I ran to verify that we are indeed missing the bytes is the
following:
1. Create a SCST based device
2. Expose the device to 2 ESX hosts
3. Format the device as VMFS5, create a test directory
4. From both hosts, I start writing to this directory (no VMs involved,
just write normal files)
At this stage, both ESX hosts try to take access to the directory.
The VMFS filesystem contains a per-directory lock which is managed by
COMPARE AND WRITE command.
Each ESX will attempt to change the VMFS lock location from unlocked to
locked to create the new file.
Obviously there are bound to be failures (which are equivalent to
programming locking conflicts), these are reported by the MISCOMPARE
sense code.
Upon these MISCOMPARE errors, the host will re-try taking the lock until
it succeeds, and will then proceed to perform the write operation on the
directory.
Due to the bug in copying the sense buffer from the SCST core to the QLA
ctio, instead of the full sense code, only the key (0xE) is sent, and
ESX does not know how to handle it resulting in IO error.
Here are the errors as they appear on the command line:
/vmfs/volumes/54a297c4-ca5af1cc-7f94-002219d20f28/ats_test #
./open_close_test-esx2.sh
./open_close_test-esx2.sh: line 8: can't create
ats_fileoptest-esx2_1.txt: Input/output error
./open_close_test-esx2.sh: line 8: can't create
ats_fileoptest-esx2_21.txt: Input/output error
./open_close_test-esx2.sh: line 8: can't create
ats_fileoptest-esx2_110.txt: Input/output error
./open_close_test-esx2.sh: line 8: can't create
ats_fileoptest-esx2_111.txt: Input/output error
In the /var/log/vmkernel.log, we can see that the sense information is
missing (0xE, 0x0, 0x0) instead of (0xE, 0x1D, 0x0).
2014-12-30T12:13:20.714Z cpu6:33519)ScsiDeviceIO: 2338:
Cmd(0x412e84f957c0) 0x89, CmdSN 0x234d from world 519051 to dev
"eui.0024f400d5020007" failed H:0x0 D:0x2 P:0x0 Valid sense data: 0xe 0x0 0x0.
2014-12-30T12:13:20.766Z cpu6:33519)ScsiDeviceIO: 2338:
Cmd(0x412e84f91d00) 0x89, CmdSN 0x2350 from world 519051 to dev
"eui.0024f400d5020007" failed H:0x0 D:0x2 P:0x0 Valid sense data: 0xe 0x0 0x0.
2014-12-30T12:13:20.766Z cpu6:33519)ScsiDeviceIO: 2338:
Cmd(0x412e80449fc0) 0x89, CmdSN 0x234f from world 519051 to dev
"eui.0024f400d5020007" failed H:0x0 D:0x2 P:0x0 Valid sense data: 0xe 0x0 0x0.
This patch fixes this issue, the test will run without a problem with the
fix (no IO errors, all the files are properly written to the directory).
Signed-off-by: Shahar Salzman <shahar.salzman@kaminario.com>
Reviewed-by: Eran Mann <eran.mann@kaminario.com>
[bvanassche: simplified implementation]
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5965 d57e44dd-8a1f-0410-8b47-8ef2f437770f
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
Coverity warns that 'handle == Q2T_SKIP_HANDLE' can never occur, because
code preceding the test has masked out a handle bit that would be
required for the test to succeed.
Fix that by extending Q2T_SKIP_HANDLE to incorporate
CTIO_INTERMEDIATE_HANDLE_MARK as well.
Reported-by: Steven J. Magnani <steve@digidescorp.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5718 d57e44dd-8a1f-0410-8b47-8ef2f437770f
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
Change a few occurrences of "conformation" into "confirmation". See also the
QLogic 2500 Series Firmware Interface Specification.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5555 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Some components don't have 'uninstall' targets although the top-level
Makefile references them. Some others don't remove the proper file.
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5290 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Not all SCST components handle DESTDIR properly, or at all.
In particular:
* INSTALL_MOD_PATH should account for DESTDIR when 'make modules_install'
is invoked, so the kernel make infrastructure deploys the modules
and runs depmod against the proper directory tree.
* depmods must include a '-b' option to reference the proper directory tree.
* Drop special ISCSI_DESTDIR.
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5289 d57e44dd-8a1f-0410-8b47-8ef2f437770f
With a realtime kernel with full preemption (CONFIG_PREEMPT_RT_FULL),
spinlocks can sleep, interrupt handlers run in thread context, and
the standard local_irq functions manipulate preemptibility, not HW
interruptibility. Under these conditions, most calls to local_irq
functions should be replaced by no-ops. The CONFIG_PREEMPT_RT patch
defines _nort versions of local_irq functions that compile away
under CONFIG_PREEMPT_RT_FULL and compile to their "normal"
equivalents otherwise.
Define _nort equivalents to support compilation against both
"normal" and RT-patched kernels, and use the _nort local_irq
functons in cases where spinlocks are taken within a
local_irq_save() or local_irq_disable() block. Without these
changes, runtime warnings about "sleeping function called from
invalid context" occur.
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
[bvanassche: Edited patch description and comment in scst_priv.h]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5288 d57e44dd-8a1f-0410-8b47-8ef2f437770f
When deriving the kernel version (KVER) from KDIR, the file
$(KDIR)/include/config/kernel.release should be preferred over
'make kernelversion'.
For example, the Ubuntu 3.2.0-23-generic kernel has a kernel.release
file containing '3.2.0-23-generic', but 'make kernelversion' returns
3.2.14. Since the modules are stored under /lib/modules/3.2.0-23-generic,
the value in kernel.release is the correct one to use.
Also:
- Evaluate KVER only once
- All depmod commands must include KVER
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
[bvanassche: Split long lines / removed trailing whitespace]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5286 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Running 'make modules_install' already triggers invocation of depmod,
hence leave it out from those Makefiles that use 'make modules_install'.
Signed-off-by: Steven J. Magnani <steve@digidescorp.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5283 d57e44dd-8a1f-0410-8b47-8ef2f437770f