Commit Graph

4443 Commits

Author SHA1 Message Date
Bart Van Assche
8b9d281144 scst.spec.in: Leave out kernel version from RPM name
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5975 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-16 16:12:38 +00:00
Bart Van Assche
d571dfe4a4 scst.spec.in: Determine version number correctly on a koji server
This patch has been tested on a koji build server and also on four
different RPM-based distributions (CentOS 7, Fedora 20, openSuSE 13.2
and SLES 11 SP3).


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5974 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-16 13:16:06 +00:00
Bart Van Assche
c7b366e8e9 scst.spec.in: Pass kernel version via RPM-variable %{kversion} instead of shell variable ${KVER}
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5973 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-16 13:12:22 +00:00
Bart Van Assche
275f8c2018 scst.spec.in: Rename variable kver into kversion
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5972 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-16 13:01:58 +00:00
Vladislav Bolkhovitin
96295c735a Report during user devices unjam LUN NOT SUPPORTED sense
Reported-By: shahar.salzman <shahar.salzman@kaminario.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5971 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-16 03:53:29 +00:00
Vladislav Bolkhovitin
9d6ed12e26 Follow up for r5968
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5970 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-16 03:16:26 +00:00
Vladislav Bolkhovitin
72abce14cd Fix READ BUFFER and WRITE BUFFER commands
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5969 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-16 01:21:10 +00:00
Bart Van Assche
670352ba89 scst_targ: Avoid triggering a kernel panic if dev_user_parse() returns SCST_CMD_STATE_STOP
Reported-by: Ilan Steinberg <ilan.steinberg@kaminario.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5968 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-15 08:58:39 +00:00
Bart Van Assche
b1966fb034 scst_targ: Use tabs instead of spaces for indentation (detected by checkpatch)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5967 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-14 08:06:12 +00:00
Bart Van Assche
7895216956 qla2x00t: Register for RSCNs in target mode
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
2015-01-13 09:38:09 +00:00
Bart Van Assche
fec8d2459c qla2x00t: Copy entire SCST sense buffer to q2x ctio
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
2015-01-13 08:55:46 +00:00
Bart Van Assche
efff5e2a20 scst_parse_unmap_descriptors(): Avoid using GFP_KERNEL in atomic context
Reported-by: Shahar Salzman <shahar.salzman@kaminario.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5964 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-13 08:51:08 +00:00
Bart Van Assche
87fb2237c0 scst: Switch to thread context before executing a reservation command
Persistent reservation commands need thread context because
scst_pr_is_cmd_allowed() locks the PR mutex. Reservation commands
either need BH or thread context. Hence switch from atomic to
thread context before processing such commands.

Reported-by: Shahar Salzman <shahar.salzman@kaminario.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5963 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-13 08:42:28 +00:00
Bart Van Assche
6cff234ab4 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5962 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-10 15:52:57 +00:00
Bart Van Assche
b158254766 scst_sysfs: return EINVAL on too big LUN
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5961 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-09 12:23:25 +00:00
Bart Van Assche
292f72e16d scst_local: Fix unique per session sas address
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5960 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-07 09:20:06 +00:00
Bart Van Assche
aed1b2f332 scst_calc_block_shift: Log block shift and sector size upon mismatch
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5959 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-06 13:25:28 +00:00
Bart Van Assche
fa29d4cd3d scst_lib: Convert spaces into tabs (reported by checkpatch)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5958 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-29 12:14:52 +00:00
Bart Van Assche
bbb89ed456 nightly build: Add kernel 3.18
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5957 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-24 14:28:36 +00:00
Bart Van Assche
c46daa8368 Spelling fix: immediatelly -> immediately
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5956 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 13:15:55 +00:00
Bart Van Assche
9cd602de2f Update for kernel 3.18
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5955 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 13:10:41 +00:00
Bart Van Assche
505a4dbc80 Spelling fix: existant -> existent
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5954 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 13:09:20 +00:00
Bart Van Assche
cf536e76b3 Spelling fix: choosen -> chosen
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5953 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 13:08:34 +00:00
Bart Van Assche
40142b6879 Spelling fix: shrinked -> shrunk
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5952 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:36:47 +00:00
Bart Van Assche
3450315283 Source code comment spelling fix: refering -> referring
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5951 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:35:51 +00:00
Bart Van Assche
dd249ab556 Spelling fix: occured -> occurred
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5950 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:35:00 +00:00
Bart Van Assche
5154cbcf5a Source code comment spelling fix: loosing -> losing
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5949 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:33:37 +00:00
Bart Van Assche
a1ffc737c0 Source code comment spelling fix: hander -> handler
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5948 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:33:06 +00:00
Bart Van Assche
8446d801b6 Source code comment spelling fix: explicitely -> explicitly
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5947 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:32:30 +00:00
Bart Van Assche
d8ec3a3873 Source code spelling fix: authentification -> authentication
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5946 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:31:08 +00:00
Bart Van Assche
d6dbe1a0b0 Source code spelling fix: addres -> address
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5945 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:29:51 +00:00
Bart Van Assche
c8d86e2811 Source code spelling fix: accesss -> access
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5944 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:28:56 +00:00
Bart Van Assche
bd100d73a3 Source code spelling fix: Equivilant -> Equivalent
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5943 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-22 12:28:13 +00:00
Vladislav Bolkhovitin
44170b30dc scst_vdisk: Remove superfluous llseek() calls
vfs_read() and vfs_write() ignore the file offset set by llseek().
Hence remove the llseek() calls that occur just before vfs_read() and
vfs_write(). See also the implementation in the Linux kernel of the
pread64() and pwrite64() system calls for examples of code that uses
vfs_read() and vfs_write().

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5942 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-20 03:49:23 +00:00
Vladislav Bolkhovitin
81ad848f2b scst_vdisk: Only accept NAA IDs allowed by SPC
See also paragraph 7.8.6.6 NAA designator format in SPC-4.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5941 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-20 03:48:07 +00:00
Vladislav Bolkhovitin
94d1c2fc6c Replace in cases, where sporadic failures are possible, HARDWARE ERROR
by INTERNAL TARGET FAILURE, which is retriable (some OS'es don't retry
HARDWARE ERROR)

Reported and suggested by Shahar Salzman <shahar.salzman@kaminario.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5940 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-19 03:55:14 +00:00
Vladislav Bolkhovitin
d9c9a8b8a2 Fallback to the old qla driver if the git one not detected
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5939 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-19 03:50:58 +00:00
Bart Van Assche
1573624301 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5938 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-17 07:48:40 +00:00
Bart Van Assche
ee86982787 doc/scst_pg.sgml: Remove trailing whitespace
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5937 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-12 09:34:55 +00:00
Bart Van Assche
b83f4faa55 scripts/generate-kernel-patch: Include scst_pg.sgml instead of sgv_cache.sgml
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5936 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-12 09:29:42 +00:00
Bart Van Assche
edcde67ddd ib_srpt: Log P_Key during login
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5935 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-11 12:37:02 +00:00
Bart Van Assche
331b72be46 scst_vdisk: Follow-up for r5932
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5934 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-11 12:31:03 +00:00
Vladislav Bolkhovitin
878a3be328 vdisk_blockio: Report invalid scatterlists
It is possible for a target driver to pass a scatterlist via
scst_cmd_set_tgt_sg() that is valid for the vdisk_fileio handler
but not for the vdisk_blockio handler. Complain loudly if an invalid
scatterlist is passed to vdisk_blockio because such scatterlists
cause silent data corruption with most Linux block drivers.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5933 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-11 04:38:04 +00:00
Vladislav Bolkhovitin
bba96aca8c scst_vdisk: Increase virtual device name length
This change makes integration with OpenStack easier since OpenStack GUIDs
are 36 characters long: 32 hex characters and four dashes.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5932 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-11 04:34:36 +00:00
Vladislav Bolkhovitin
10ebf80e7a Docs update
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5931 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-11 04:27:17 +00:00
Bart Van Assche
c641574046 rpm build: Add support for qla2x00t driver in QLogic git repository
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5929 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-09 12:33:16 +00:00
Vladislav Bolkhovitin
0d8b4dce6c Web updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5928 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-06 05:02:27 +00:00
Vladislav Bolkhovitin
245b8b0e2b Oops, fix for the previous commit
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5914 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-04 23:43:51 +00:00
Vladislav Bolkhovitin
3dec4655b2 FORMAT commands should be strictly serialized
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5913 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-04 23:41:52 +00:00
Bart Van Assche
0717d99a62 /etc/init.d/scst: Exit with status code 0 upon 'start' if already running
Reported-by: Dimitar Tanev <dimitar@linuxdevgroup.org>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5912 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-04 12:19:56 +00:00