Vladislav Bolkhovitin 93eb067bef scst: Avoid that scst_write_same() crashes for large data len
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
2013-11-19 05:51:39 +00:00
2013-03-08 21:25:45 +00:00
2013-10-04 04:52:26 +00:00
2013-10-31 03:48:59 +00:00
2013-11-14 10:10:37 +00:00
2013-10-23 04:25:27 +00:00
2013-09-07 04:44:26 +00:00
2011-04-19 22:56:07 +00:00
2013-02-20 02:05:29 +00:00
2008-06-26 16:35:10 +00:00

This is the SCST development repository. It contains not a single
project SCST as one can think, but a number of them, which are divided
as the following:

1. SCST core in scst/ subdirectory

2. Administration utility for SCST core scstadmin in scstadmin/

3. Target drivers in own subdirectories qla2x00t/, iscsi-scst/, etc.

4. User space programs in usr/ subdirectory, like fileio_tgt.

5. Some various docs in doc/ subdirectory.

Those subprojects are in most cases independent from each other,
although some of them depend from the SCST core. They put in the single
repository only to simplify their development, they are released
independently.

Thus, use "make all" only if you really need to build everything.
Otherwise build only what you need, like for iSCSI-SCST:

make scst scst_install iscsi iscsi_install

For more information about each subproject see their README files.

Vladislav Bolkhovitin <vst@vlnb.net>, http://scst.sourceforge.net
Description
No description provided
Readme 33 MiB
Languages
C 90.1%
Perl 4.2%
Shell 1.8%
HTML 1.7%
Makefile 1.2%
Other 0.9%