A quote from SBC-3 about WRITE SAME (10): "If the number of
logical blocks specified to be unmapped or written exceeds the value
indicated in the MAXIMUM WRITE SAME LENGTH field in the Block Limits
VPD page (see 6.6.3), then the device server shall terminate the command
with CHECK CONDITION status with the sense key set to ILLEGAL REQUEST
and the additional sense code set to INVALID FIELD IN CDB."
This patch fixes the following crash since with the current implementation
data_len >= 2**63 makes (unsigned)ws_sg_cnt >= 2**31 and this causes
sg_init_table() to crash as follows:
BUG: unable to handle kernel paging request at 00000027ffffffe8
IP: [<ffffffff8120d51e>] sg_init_table+0x5e/0x90
CPU: 1 PID: 10297 Comm: disk014_1 Tainted: G O 3.11.0-debug+ #1
RIP: 0010:[<ffffffff8120d51e>] [<ffffffff8120d51e>] sg_init_table+0x5e/0x90
Call Trace:
[<ffffffffa02e4b46>] scst_write_same+0x236/0x340 [scst]
[<ffffffffa034db30>] ? vdisk_exec_write_same_unmap.isra.35+0x170/0x170 [scst_vdisk]
[<ffffffffa034dba4>] vdisk_exec_write_same+0x74/0x170 [scst_vdisk]
[<ffffffffa034824e>] vdev_do_job+0x15e/0x390 [scst_vdisk]
[<ffffffffa03484a5>] vdisk_exec+0x25/0x70 [scst_vdisk]
[<ffffffffa02cafb5>] scst_do_real_exec+0xa5/0x3d0 [scst]
[<ffffffffa02ce2da>] scst_exec_check_blocking+0xea/0x310 [scst]
[<ffffffffa02ce695>] scst_exec_check_sn+0x195/0x2f0 [scst]
[<ffffffffa02cff31>] scst_process_active_cmd+0x521/0x750 [scst]
[<ffffffffa02d01e1>] scst_do_job_active+0x81/0x1a0 [scst]
[<ffffffffa02d0537>] scst_cmd_thread+0x157/0x340 [scst]
[<ffffffff81069ea6>] kthread+0xd6/0xe0
[<ffffffff814debfc>] ret_from_fork+0x7c/0xb0
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5122 d57e44dd-8a1f-0410-8b47-8ef2f437770f
I think the comments in scst.h for data_direction and expected_data_direction
can be made more clear. The patch below makes the comments for these two
variables more detailed.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5121 d57e44dd-8a1f-0410-8b47-8ef2f437770f
Avoid that sparse complains about a local symbol not having been declared
static (scst_pool_dep_map and scst_conn_dep_map). Also avoid that sparse
reports these two variables as unused in the procfs build.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5110 d57e44dd-8a1f-0410-8b47-8ef2f437770f
the timeout value. The problem is that if commands were started at
00:00:05 and 00:00:10 and the timeout value was 15 seconds and the
first command completed ok, then conn_rsp_timer_fn would have run
at 00:00:20 and rescheduled the next conn_rsp_timer_fn run for 15
secs from that time (00:00:35). But, we would have wanted to check on
the second command at 15 secs after its write_start time which is
00:00:25.
This patch has us reschedule the next conn_rsp_timer_fn run for
the req's write_start time + its timeout.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5093 d57e44dd-8a1f-0410-8b47-8ef2f437770f
1. If we have a nop in flight then we do not really need to send
more to test if the other side is still there. Either that nop
will timeout and conn will be dropped or it will complete
and last_rcv_time will be updated.
2. We are sending nop-ins every nop_in_interval seconds, but if
we got a data half way in to the window, then when conn_nop_in_delayed_work_fn
is run it was scheduling the next check to be nop_in_interval more
seconds. With the current settings this could end up with us waiting
59 secs before sending a nop and about 130 secs for it to timeout, when
at 61 it should be timing out and getting cleaned up already. This patch
has us take into account when the last time we got data to try and
reschedule the next nop check closer to nop_in_interval from that time.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5092 d57e44dd-8a1f-0410-8b47-8ef2f437770f
when a command/data is in the process of being sent. The snd
buffer space goes to zero and sendpage returns -EAGAIN. We then
wait for space to open. If space never opens then the cmd rsp timer
fires and the session/connection is dropped.
During that time we could try to send a nop as a ping, but it
is stuck behind that other command that got EAGAIN and we are
waiting for space to open to send them. We would expect the
nop in timer to fire before the cmd rsp timer, but it cannot
becuase the nop is sitting in the internal iscsi-scst queue.
This patch just has us start the timer ont he nop in right
away.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5091 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch does not change any functionality other than the message
printed when it takes more than one second before the completion is
signalled.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5086 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This patch restores support for the FIXED bit in tape commands. This
patch is necessary since some time ago SCST_TRANSFER_LEN_TYPE_FIXED has
been changed from 1 into 4. From the SVN change log:
r4896 | vlnb | 2013-06-06 21:43:51 -0700 (Thu, 06 Jun 2013) | 9 lines
scst_lib: Rework the CDB parsing routines
Factor out common code into a new function.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5084 d57e44dd-8a1f-0410-8b47-8ef2f437770f