Commit Graph

4479 Commits

Author SHA1 Message Date
Bart Van Assche
b686ed343d ib_srpt: Remove TRACE_ENTRY()/TRACE_EXIT() macro invocations
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6092 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-16 09:46:40 +00:00
Bart Van Assche
42bc56a0a2 ib_srpt: Add missing kernel-doc comments
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6091 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-16 09:44:25 +00:00
Bart Van Assche
f9815c620d ib_srpt: Eliminate struct srpt_tgt
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6090 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-16 09:41:25 +00:00
Bart Van Assche
f80ab08f9f nightly build: Update a kernel version
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6087 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-15 09:07:44 +00:00
Bart Van Assche
f2796fa60b ib_srpt: Remove a structure member that became superfluous due to the previous commit
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6086 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-13 13:12:06 +00:00
Bart Van Assche
0d452d4712 ib_srpt: Drop support for one_target_per_port=false
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6085 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-13 12:59:18 +00:00
Bart Van Assche
5019ae319e scst: Introduce file_inode()
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
[bvanassche: Constified file_inode() argument / added iscsi-scst conversion]


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6084 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-12 07:48:10 +00:00
Bart Van Assche
087c7352ac srpt/README: Document how to configure scsi-mq at the initiator side
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6028 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-09 09:27:38 +00:00
Bart Van Assche
3e59f81ea5 scripts/spread-mlx4-ib-interrupts: Add to repository
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6027 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-09 09:26:10 +00:00
Bart Van Assche
f4217a8b48 ib_srpt: Clarify a log message
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6026 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-08 12:53:02 +00:00
Bart Van Assche
b05e8b60a7 scst_targ: Fix spelling in a source code comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6025 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-06 15:55:16 +00:00
Bart Van Assche
c679c4c785 scst_vdisk: Fix spelling in a source code comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6024 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-06 15:53:35 +00:00
Bart Van Assche
a4d1421b4a scst_vdisk: Fix spelling in a source code comment
Signed-off-by: Aayush Kasurde <aayush.kasurde@gmail.com>


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6023 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-06 15:51:58 +00:00
Bart Van Assche
2de7915259 ib_srpt: Remove an obsolete comment
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6022 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-06 15:11:33 +00:00
Bart Van Assche
078b9d3bbe ib_srpt: Clean up header file ib_srpt.h
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6021 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-06 14:39:55 +00:00
Bart Van Assche
070986a738 ib_srpt: Document #endif CONFIG_SCST_PROC statements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6020 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-06 13:55:51 +00:00
Bart Van Assche
8446ccd282 ib_srpt: Remove emacs local variables
This patch does not change any functionality.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6019 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-05 16:23:25 +00:00
Bart Van Assche
f58feb1c73 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6018 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-02 16:46:44 +00:00
Vladislav Bolkhovitin
8732cf3036 scst_scsi_exec_async(): Fix a recently introduced memory leak
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6016 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-31 04:41:09 +00:00
Vladislav Bolkhovitin
c7868c2733 Docs updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6015 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-30 01:35:32 +00:00
Vladislav Bolkhovitin
4321761716 Cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5991 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-28 05:07:46 +00:00
Bart Van Assche
387a603482 ib_srpt: Detect Mellanox OFED 2.3 correctly
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5990 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-26 11:32:32 +00:00
Vladislav Bolkhovitin
18ec809a45 scst_local: Rework data direction detection code
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5989 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-24 05:37:57 +00:00
Vladislav Bolkhovitin
31c8f996df scst_vdisk: Fix zero-copy read for tmpfs
For some filesystems, e.g. tmpfs, address_space.readpage is NULL.
Disable zero-copy reading for such filesystems. See also shmem_aops
in mm/shmem.c. See also inode_init_always() and empty_aops in fs/inode.c.

This patch avoids that the following call trace is triggered:

BUG: unable to handle kernel NULL pointer dereference at (null)
Call Trace:
 [<ffffffffa0547d66>] prepare_read+0x106/0x1d0 [scst_vdisk]
 [<ffffffffa0547f20>] fileio_alloc_data_buf+0xf0/0x330 [scst_vdisk]
 [<ffffffffa046fc9b>] scst_prepare_space+0x9b/0x6e0 [scst]
 [<ffffffffa047d4d5>] scst_process_active_cmd+0x545/0x840 [scst]
 [<ffffffffa047dad2>] scst_cmd_init_done+0x302/0x5d0 [scst]
 [<ffffffffa0563ab2>] scst_cmd_init_stage1_done.constprop.37+0x12/0x20 [iscsi_scst]
 [<ffffffffa056a9ea>] scsi_cmnd_start+0x25a/0x550 [iscsi_scst]
 [<ffffffffa056b4a8>] cmnd_rx_start+0x148/0x1a0 [iscsi_scst]
 [<ffffffffa056e4f8>] process_read_io+0x3b8/0x800 [iscsi_scst]
 [<ffffffffa056ea07>] scst_do_job_rd+0xc7/0x220 [iscsi_scst]
 [<ffffffffa056efed>] istrd+0x16d/0x2e0 [iscsi_scst]
 [<ffffffff81079efd>] kthread+0xed/0x110
 [<ffffffff817227fc>] ret_from_fork+0x7c/0xb0

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5988 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-22 05:13:59 +00:00
Vladislav Bolkhovitin
fdc6cdf1ed scst: Suppress a smatch warning in vdisk_unmap_range()
Avoid that the static source code analysis tool 'smatch' reports
the following warning:

vdisk_unmap_range() warn: should 'blocks << cmd->dev->block_shift' be a 64 bit type?

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5987 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-22 05:10:42 +00:00
Vladislav Bolkhovitin
a3d1d4f809 scst_vdisk: Micro-optimize vdisk_caching_pg
This patch does not change any behavior but micro-optimizes
vdisk_caching_pg(). Declaring the array caching_pg[] const reduces
11 bytes from the assembler code of this function.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5986 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-22 05:09:17 +00:00
Vladislav Bolkhovitin
f5a3f799c3 [PATCH] scst_main: Suppress a checkpatch warning triggered by INIT_CACHEP{,_ALIGN}
Avoid that checkpatch v3.18 reports the following warning for these
two macros:

WARNING: Macros with flow control statements should be avoided

This patch does not change any functionality.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5985 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-22 05:06:45 +00:00
Vladislav Bolkhovitin
ca87894980 [PATCH] scst_local: Fix bidirectional command support
scsi_setup_cmnd() sets sc_data_direction to DMA_TO_DEVICE for bidirectional
commands. Hence test SCpnt->request->next_rq instead of sc_data_direction
to figure out whether or not a command is bidirectional.

Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5984 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-22 05:03:17 +00:00
Bart Van Assche
3bb41e9eca scst.h: Fix a sparse warning for kernels 2.6.29..2.6.31
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5983 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-21 13:11:56 +00:00
Vladislav Bolkhovitin
eb824e0038 Fix returning changeable values for caching mode page
Reported by Consus <consus@gmx.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5982 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-21 04:20:53 +00:00
Vladislav Bolkhovitin
7a18672a83 Follow up for r5979
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5981 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-21 04:15:42 +00:00
Bart Van Assche
acc5f47e01 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5980 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-20 17:13:13 +00:00
Bart Van Assche
628f3939bc scst: Rework SCSI pass-through support for kernel versions >= 2.6.30
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
2015-01-20 15:04:23 +00:00
Vladislav Bolkhovitin
cab2a22480 Revert r5963 as not needed
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5978 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-20 04:20:13 +00:00
Vladislav Bolkhovitin
b7169c9163 Revert r5964 as not needed
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5977 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-20 04:18:07 +00:00
Bart Van Assche
0a43946351 scst.spec.in: Add DKMS support
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5976 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-01-16 16:20:10 +00:00
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