svn+ssh://vlnb@svn.code.sf.net/p/scst/svn/trunk
........
r5984 | vlnb | 2015-01-21 21:03:17 -0800 (Wed, 21 Jan 2015) | 9 lines
[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>
........
r5988 | vlnb | 2015-01-21 21:13:59 -0800 (Wed, 21 Jan 2015) | 27 lines
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>
........
r5989 | vlnb | 2015-01-23 21:37:57 -0800 (Fri, 23 Jan 2015) | 5 lines
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/branches/3.0.x@6112 d57e44dd-8a1f-0410-8b47-8ef2f437770f
svn+ssh://vlnb@svn.code.sf.net/p/scst/svn/trunk
........
r5955 | bvassche | 2014-12-22 05:10:41 -0800 (Mon, 22 Dec 2014) | 1 line
Update for kernel 3.18
........
r5959 | bvassche | 2015-01-06 05:25:28 -0800 (Tue, 06 Jan 2015) | 1 line
scst_calc_block_shift: Log block shift and sector size upon mismatch
........
r5960 | bvassche | 2015-01-07 01:20:06 -0800 (Wed, 07 Jan 2015) | 4 lines
scst_local: Fix unique per session sas address
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
........
r5961 | bvassche | 2015-01-09 04:23:25 -0800 (Fri, 09 Jan 2015) | 4 lines
scst_sysfs: return EINVAL on too big LUN
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
........
r5965 | bvassche | 2015-01-13 00:55:46 -0800 (Tue, 13 Jan 2015) | 68 lines
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/branches/3.0.x@6110 d57e44dd-8a1f-0410-8b47-8ef2f437770f
svn+ssh://vlnb@svn.code.sf.net/p/scst/svn/trunk
........
r5933 | vlnb | 2014-12-10 20:38:04 -0800 (Wed, 10 Dec 2014) | 11 lines
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>
........
r5940 | vlnb | 2014-12-18 19:55:14 -0800 (Thu, 18 Dec 2014) | 7 lines
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/branches/3.0.x@6109 d57e44dd-8a1f-0410-8b47-8ef2f437770f