Commit Graph

1290 Commits

Author SHA1 Message Date
Vladislav Bolkhovitin
369863f015 Allow install SCST in any location
Currently the install location of SCST is pretty much hard coded into 
the Makefiles to be /usr/local.

I am custom building a system for ZFS & SCST and I want to install in 
/usr instead of /usr/local.

Currently I am doing a “find . -name Makefile -exec sed -i 's:/usr/local:/usr:g'
{} \;” to accommodate this.

This patch fixes it.

From Sietse van Zanen <sietse@wizdom.nu>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4791 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-08 21:25:45 +00:00
Vladislav Bolkhovitin
9ea9eec4ef Cleanups and minor fixes
Suggested by Manfred_Knick <Manfred.Knick@T-Online.de>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4790 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-08 21:00:09 +00:00
Vladislav Bolkhovitin
eb4d0f3cb9 Fix compilation breakage on older kernels
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4789 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-07 20:12:25 +00:00
Vladislav Bolkhovitin
41ec60e529 Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4788 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-05 21:36:25 +00:00
Vladislav Bolkhovitin
c7f6a46905 Better to have those conditional defines in the head of the file, because #include's depend on them
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4787 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-05 21:25:54 +00:00
Vladislav Bolkhovitin
60cd734aef More micro-optimizations
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4786 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-05 01:23:48 +00:00
Vladislav Bolkhovitin
b9c0b9d92d Another micro-optimization: cache align all fast path structures
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4785 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-04 23:51:16 +00:00
Vladislav Bolkhovitin
d5d2065eca Post r4779 safety measure to ensure that SCST core and target drivers see the same size of SCST structures.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4781 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-02 04:36:53 +00:00
Vladislav Bolkhovitin
ae8e9ef049 Micro-optimization: allow target drivers to prealloc scst_cmd + update qla2x00t to use this facility
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4779 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-02 00:52:26 +00:00
Vladislav Bolkhovitin
f86ee4d788 Minimize logging
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4777 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-28 20:20:56 +00:00
Bart Van Assche
1864d41919 scst_sysfs: Change one space into a tab because checkpatch complained about it
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4775 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-28 07:16:51 +00:00
Vladislav Bolkhovitin
0cc1cd07b9 Microoptimizations
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4774 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-27 21:53:46 +00:00
Vladislav Bolkhovitin
f5ed343084 trace_level help updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4773 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-27 02:56:32 +00:00
Vladislav Bolkhovitin
2c13f6b7e0 Logging cleanup: hide most verbose logs by default
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4772 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-27 02:50:14 +00:00
Bart Van Assche
52f0d63ee6 nightly build: Add kernel 3.8 support files
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4769 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-23 13:47:51 +00:00
Vladislav Bolkhovitin
79bf4e77c6 Update for 3.8 kernels
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4768 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-23 00:44:56 +00:00
Vladislav Bolkhovitin
10ca1d2f20 Copyrights updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4767 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-20 02:05:29 +00:00
Vladislav Bolkhovitin
d3813d3e1b Cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4765 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-20 01:20:56 +00:00
Vladislav Bolkhovitin
6eadaff9cb Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4763 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-18 23:50:29 +00:00
Vladislav Bolkhovitin
5a6024c859 Follow-up for the previous commit
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4762 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-16 04:09:11 +00:00
Vladislav Bolkhovitin
8d32ad63a1 Performance micro-optimization: use sg_next_inline() instead of sg_next()
Now we have sg_next_inline(), so let's use it everywhere.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4761 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-16 04:03:58 +00:00
Vladislav Bolkhovitin
a327b6e700 scst: Avoid that INQUIRY of a non-existing LUN can trigger a NULL pointer dereference
This patch fixes the following kernel oops:

[7781]: scst: scst_translate_lun:3935:tgt_dev for LUN 1 not found, command to unexisting LU (initiator local3, target local3)?
BUG: unable to handle kernel NULL pointer dereference at 0000000000000500
IP: [<ffffffffa027662e>] scst_set_resp_data_len+0x17e/0x1c0 [scst]
PGD 2de7a067 PUD 2dd4d067 PMD 0
Oops: 0000 [#1] SMP
Modules linked in: scst_local(O) iscsi_scst(O) scst_vdisk(O) scst(O) brd netconsole configfs ib_iser rdma_cm ib_cm iw_cm ib_sa ib_mad ib_core ib_addr iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi joydev aesni_intel ablk_helper hid_generic cryptd lrw aes_x86_64 xts usbhid hid gf128mul intel_agp i2c_piix4 intel_gtt agpgart processor psmouse microcode button binfmt_misc lp parport ext4 mbcache jbd2 floppy ata_piix zlib_deflate libcrc32c [last unloaded: scst]
CPU 3
Pid: 7781, comm: kworker/u:5 Tainted: G           O 3.8.0-rc7-debug+ #1 Bochs Bochs
RIP: 0010:[<ffffffffa027662e>]  [<ffffffffa027662e>] scst_set_resp_data_len+0x17e/0x1c0 [scst]
Process kworker/u:5 (pid: 7781, threadinfo ffff88002dc18000, task ffff88003d306450)
Call Trace:
 [<ffffffffa027aa10>] scst_set_lun_not_supported_inquiry+0x140/0x400 [scst]
 [<ffffffffa027adbf>] scst_set_cmd_error+0xef/0x210 [scst]
 [<ffffffffa026aaa1>] __scst_init_cmd+0x1c1/0x250 [scst]
 [<ffffffffa026aefb>] scst_init_cmd+0x6b/0x320 [scst]
 [<ffffffffa026e914>] scst_cmd_init_done+0x124/0x5b0 [scst]
 [<ffffffffa0340a9e>] scst_local_queuecommand+0x1ae/0x3c0 [scst_local]
 [<ffffffff81323cd0>] scsi_dispatch_cmd+0x150/0x4b0
 [<ffffffff8132b091>] scsi_request_fn+0x361/0x530
 [<ffffffff812157b7>] __blk_run_queue+0x37/0x50
 [<ffffffff81221e01>] blk_execute_rq_nowait+0x81/0x100
 [<ffffffff81221fd2>] blk_execute_rq+0x152/0x200
 [<ffffffff8132a75e>] scsi_execute+0xee/0x180
 [<ffffffff8132b92d>] scsi_execute_req+0xbd/0x130
 [<ffffffff8132d647>] scsi_probe_and_add_lun+0x257/0xe10
 [<ffffffff8132ea73>] __scsi_scan_target+0x2a3/0x790
 [<ffffffff8132f0ee>] scsi_scan_target+0xfe/0x110
 [<ffffffffa033f81c>] scst_process_aens+0xcc/0x210 [scst_local]
 [<ffffffffa033fb39>] scst_aen_work_fn+0x79/0x140 [scst_local]
 [<ffffffff810630c8>] process_one_work+0x1a8/0x6e0
 [<ffffffff81063a3f>] worker_thread+0x15f/0x3e0
 [<ffffffff8106a17d>] kthread+0xed/0x100
 [<ffffffff815252ac>] ret_from_fork+0x7c/0xb0
---[ end trace b2eb71a8ecb7acf3 ]---

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4758 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-14 02:42:35 +00:00
Vladislav Bolkhovitin
cb39459fa8 sgv_pool_create(): Return NULL if sgv_pool_init() fails
The current implementation of sgv_pool_create() returns a dangling
pointer if pool allocation succeeds but sgv_pool_init() fails. Modify
sgv_pool_create() such that a NULL pointer is returned if that happens.
This was detected by Coverity.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4756 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-06 21:41:41 +00:00
Vladislav Bolkhovitin
991158998d Make new MS test happy
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4755 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-02-05 21:50:08 +00:00
Vladislav Bolkhovitin
f0e65cb9d1 Eliminate another compiler warning in some build modes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4746 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-25 00:28:50 +00:00
Vladislav Bolkhovitin
c87f16b41e Eliminate compiler warning in some build modes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4745 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-25 00:02:28 +00:00
Vladislav Bolkhovitin
04b790e43a Orig offset should also be saved during SG entries manipulations
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4744 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-19 01:59:01 +00:00
Vladislav Bolkhovitin
5dcbbc5aaa Cleanup
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4743 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-17 21:13:12 +00:00
Vladislav Bolkhovitin
61f58f5792 Minor logging fixes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4742 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-16 02:04:05 +00:00
Vladislav Bolkhovitin
844071da62 vdisk_blockio: Make Windows 2003 FORMAT succeed
Reported-by: scst niko <scst.niko@gmail.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4738 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-16 00:04:42 +00:00
Vladislav Bolkhovitin
9226ba652c scst, SCSI pass-through: Do not complain unnecessarily about max_hw_sectors
cmd->bufflen is in bytes so it has to be divided by the sector size before
being compared with queue_max_hw_sectors(). Other changes included in this
patch:
* Print the "rc" error code as a signed integer instead of as an unsigned
  hex number.
* Change "(int)rc" into "rc". The cast isn't necessary because rc has type
  int.
* Insert a "0x" prefix in front of the SCSI CDB opcode.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4727 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-09 01:42:10 +00:00
Bart Van Assche
c3910d8367 Build fix for Grsecurity (e.g. Gentoo-Hardened)
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4724 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-07 15:29:21 +00:00
Vladislav Bolkhovitin
563e7c248c Avoid that scst_abort_cmd() triggers a false positive in Coverity
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4682 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-05 02:54:08 +00:00
Bart Van Assche
c70fad0839 Revert r4678 because it was incomplete
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4681 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-04 09:43:52 +00:00
Vladislav Bolkhovitin
e7e9101efd Automate release archive generation
This patch makes it easier to generate the release archives that
can be downloaded from http://scst.sourceforge.net/downloads.html.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4679 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-04 00:29:30 +00:00
Vladislav Bolkhovitin
59affce667 scst pr: Use get_unaligned_be64() and put_unaligned_be64()
Clean up the code for converting to and from the be64 data type as follows:
* Change get_unaligned((__be64 *)p) into get_unaligned_be64(p).
* Change put_unaligned(value, (__be64 *)p) into put_unaligned_be64(value, p).

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4678 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-04 00:10:35 +00:00
Vladislav Bolkhovitin
d03c8b7729 scst: Simplify __scst_get_buf() and __scst_get_sg_page()
Signed-off-by: Bart Van Assche <bvanassche@acm.org>

with some further simplifications



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4673 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-31 23:48:03 +00:00
Vladislav Bolkhovitin
df5faa838e scst: Simplify the data buffer tracing code
Signed-off-by: Bart Van Assche <bvanassche@acm.org>




git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4672 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-28 23:39:19 +00:00
Vladislav Bolkhovitin
e2245ce384 scst_vdisk: Include device name in EOD error message
Include the device name in the end-of-device error message to make it
easy to find out which device this message applies to.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4671 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-28 23:31:12 +00:00
Vladislav Bolkhovitin
874f8d5943 Fix possible crash if misbehaving dev handler tries to set too big response data len.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4670 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-28 23:20:07 +00:00
Vladislav Bolkhovitin
3f77da8c4d Fix ILI handling to have full 32 bits handling
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4669 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-28 23:19:13 +00:00
Vladislav Bolkhovitin
da3337faae scst: Avoid truncating requests larger than 512 KB
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4668 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-28 03:13:13 +00:00
Vladislav Bolkhovitin
b08857591c Micro-optimize scst_adjust_sg() and scst_restore_sg_buff()
Micro-optimize scst_adjust_sg() and scst_restore_sg_buff() by replacing
two variables (orig_sg and orig_sg_entry, a pointer and an integer) by
one variable (orig_sg_entry, a pointer to a scatterlist element). This
allows to eliminate one assignment in scst_adjust_sg() and one read in
scst_restore_sg_buff().

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4666 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-28 02:43:10 +00:00
Vladislav Bolkhovitin
55a596b073 Fix missed locking
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4657 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-20 02:26:28 +00:00
Vladislav Bolkhovitin
5fe3432935 scst_get_unique_sess_name(): Handle out-of-memory properly
Return NULL instead of triggering a NULL pointer dereference if out
of memory. Detected by Coverity.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4656 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-20 02:20:24 +00:00
Vladislav Bolkhovitin
47db473269 Remove a superfluous pair of braces
Avoid that checkpatch v3.7 reports the following warning:

WARNING: braces {} are not necessary for any arm of this statement

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4655 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-20 02:17:23 +00:00
Bart Van Assche
12313bf114 nightly build: Add kernel 3.7 patches
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4647 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-18 08:54:50 +00:00
Vladislav Bolkhovitin
299c407697 Update for kernel 3.7
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4645 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-17 23:09:58 +00:00
Vladislav Bolkhovitin
df9b760738 PR: Compute scope field correctly
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4643 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-13 21:08:29 +00:00
Vladislav Bolkhovitin
c7c0672b51 Fir corner case handling in vdisk_attach_tgt()
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reported-by: Sebastian Riemer <sebastian.riemer@profitbricks.com>
Tested-by: Sebastian Riemer <sebastian.riemer@profitbricks.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4642 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-12-13 21:06:17 +00:00