Commit Graph

4243 Commits

Author SHA1 Message Date
Bart Van Assche
f4a38d3e6e ib_srpt: Complain if another ib_srpt.ko kernel module already exists
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5621 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-24 13:32:18 +00:00
Vladislav Bolkhovitin
5ba55f4768 scst_vdisk: Split vdisk_exec_inquiry()
Make vdisk_exec_inquiry() easier to read by moving the code
for the implementation of each VPD page into a separate function.
This patch does not change any functionality.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5620 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-24 04:45:08 +00:00
Bart Van Assche
b0ce21767f nightly build: Add kernel version 3.15.1
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5619 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-20 05:56:36 +00:00
Vladislav Bolkhovitin
b6f2a47ee8 Change BUG_ON(1) into BUG()
With CONFIG_BUG=y both BUG() and BUG_ON(1) halt the system. However,
with CONFIG_BUG=n BUG() halts the system but BUG_ON(1) not. To avoid
such subtleties, change BUG_ON(1) into BUG().

See also patch Josh Triplett, "bug: Make BUG() always stop the machine",
7 April 2014 (commit ID a4b5d580e07875f9be29f62a57c67fbbdbb40ba2).

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5618 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-20 04:10:40 +00:00
Vladislav Bolkhovitin
533d5546b0 scst: Avoid that sparse complains about unreachable code
Remove the code after BUG() statements to avoid that smatch
complains about unreachable code. Hide the spin_unlock() statements
before BUG() statements for static analysis tools to avoid that
sparse complains about locking imbalances.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5617 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-20 04:09:11 +00:00
Vladislav Bolkhovitin
23116c1598 scst: Exclude certain locking code from static analysis
Loops with locking statements and also lock and unlock
statements guarded by an if-statement trigger false positive
warnings when analyzing the SCST code with smatch and/or sparse.
Hence exclude such code from static analysis.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5616 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-20 04:05:11 +00:00
Vladislav Bolkhovitin
6b32f4ae81 scst, iscsi-scst: Fix RHEL 5 compilation warnings
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5615 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-20 04:03:40 +00:00
Vladislav Bolkhovitin
c833137130 iscsi-scst: Suppress a compiler warning
Avoid that the following compiler warning is reported when compiling
iscsi-scst:

chap.c: In function 'chap_rand':
chap.c:348:5: warning: ignoring return value of 'read', declared with attribute warn_unused_result [-Wunused-result]
     (void)read(fd, &r, sizeof(r));
     ^

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5614 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-20 04:02:00 +00:00
Vladislav Bolkhovitin
18e4fb0c83 scst: Convert a loop to keep smatch happy
Avoid that smatch reports the following warning:
scst_init_session() info: loop could be replaced with if statement.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5613 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-20 04:00:41 +00:00
Bart Van Assche
e902f79ecf kernel module installation: Skip "depmod" when building an RPM
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5612 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-19 12:48:25 +00:00
Bart Van Assche
1fdd3d9a8d nightly build: Add kernel 3.15 build infrastructure
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5611 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-19 07:09:53 +00:00
Vladislav Bolkhovitin
b5c649ef5c Update for 3.15 kernels
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5610 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-19 03:51:48 +00:00
Bart Van Assche
4a179f7037 nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5609 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-17 06:37:08 +00:00
Vladislav Bolkhovitin
12c4e0fe0a scst: Make access control group removal behavior configurable
SCST rejects removal of an access control group with one or more
sessions with error code -EBUSY. Make it easy to change this
behavior into forcibly closing sessions when an access control
group is removed.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5608 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-17 00:50:46 +00:00
Bart Van Assche
732ce5ca89 fcst: Handle frame send failures properly
Retry sending XFER_RDY, data and response frames if the network
driver reports that sending failed (-ENOMEM) instead of reporting
a kernel warning (WARN_ON(1)). If sending XFER_RDY or data frames
failed for another reason, report this to the initiator as a
write error (ASC = 03; ASCQ = 00 which stands for PERIPHERAL
DEVICE WRITE FAULT). If sending a response frame failed with
another error code than -ENOMEM, do not send a response.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5607 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-14 17:18:34 +00:00
Bart Van Assche
d937c0886d fcst: Move exch_done() calls into ft_cmd_done()
This patch ensures that exch_done() gets called if an fcst
callback returns SCST_TGT_RES_FATAL_ERROR.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5606 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-14 17:17:56 +00:00
Bart Van Assche
b32ef39546 fcst: Remove an unused variable
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5605 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-14 17:10:58 +00:00
Vladislav Bolkhovitin
2597448a4a scst: Help Coverity recognize that vmalloc(0) returns NULL
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5603 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-13 23:58:28 +00:00
Vladislav Bolkhovitin
dc37ed9b4d scst_pr_read_reservation(): Initialize returned buffer
Avoid that this function returns an uninitialized buffer to the
initiator if buffer_size < 8. Detected by Coverity.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5602 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-13 23:57:26 +00:00
Vladislav Bolkhovitin
14f4e35b64 scst_local: Add close_session() callback function
This is useful for triggering the session reassignment code via
the scst_local driver.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5601 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-13 22:31:42 +00:00
Vladislav Bolkhovitin
8848b06e68 scst: Avoid that W=1 triggers complaints about unused variables
Avoid that building scst with W=1 triggers compiler warnings about
variables that are set but not used. See also the documentation of
the gcc compiler flag -Wunused-but-set-variable.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5600 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-13 22:24:06 +00:00
Bart Van Assche
facea4c337 ib_srpt: Make one_target_per_port the default mode
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5598 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-13 06:55:23 +00:00
Vladislav Bolkhovitin
523fe73096 Forgotten versions updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5597 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-13 05:03:17 +00:00
Vladislav Bolkhovitin
ca9b38693b scst: Switch from the cpu_*() to the cpumask_*() API
The cpus_*() functions were deprecated via patch "cpumask:
introduce new API, without changing anything" (November 2008,
commit ID 2d3854a37e8b). Hence switch from the cpus_*() API to
the cpumask_*() API.

This patch has the intended side effect of not adding the "[key]"
property to cpumask sysfs attributes that contain the default
cpumask. The current code namely reads uninitialized bits on
systems where nr_cpu_ids < NR_CPUS because cpus_equal() compares
more bits than those that were set by cpumask_copy().

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5596 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-13 04:52:18 +00:00
Bart Van Assche
dc869faeca ib_srpt: Make non-OFED build work again
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5595 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-12 13:38:38 +00:00
Bart Van Assche
c7f9bcd1c0 ib_srpt: Set MOFED include path correctly if MOFED has been installed with --add-kernel-support
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5594 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-12 11:33:00 +00:00
Bart Van Assche
2faf5417be nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5593 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-12 09:15:50 +00:00
Bart Van Assche
7294df5dc4 scst.h: Move definition of swap()
Make sure that the definition of swap() is guarded by
"#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)" only instead
of "#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)" and
"#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)".


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5592 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-12 08:38:45 +00:00
Vladislav Bolkhovitin
905ffef345 scst: Introduce scst_lookup_tgt_dev()
This patch does not change any functionality.

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

with some improvements



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5590 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 22:07:00 +00:00
Vladislav Bolkhovitin
763de61f23 scst: Clean up __scst_resume_activity()
Move all management commands from scst_delayed_mgmt_cmd_list to the
active command list during resume instead of only the first one.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5589 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 21:42:08 +00:00
Vladislav Bolkhovitin
a2feffdcfe scst_local: Support LUN numbers >= 16384
Add support for 32-bit LUN numbers. As soon as the patches that add
64-bit LUN support are upstream this patch will also make 64-bit
LUN support available in scst_local.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5588 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 21:00:16 +00:00
Vladislav Bolkhovitin
3f2485ede0 scst: Add support for 64-bit LUNs
The datatype of scsi_device.lun will be changed from u32 into u64
in the near future. Update SCST accordingly. These changes have
been implemented such that these are compatible with 32-bit and
64-bit LUNs.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5587 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 20:57:03 +00:00
Vladislav Bolkhovitin
325efae944 scst_lib: Introduce additional temporary variables
Make the code slightly easier to read by introducing temporary
variables for the expressions 'tgt_dev->sess' and 'sess->tgt->tgtt'.
This patch does not change any functionality.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5586 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 19:39:51 +00:00
Vladislav Bolkhovitin
1b95b72af6 scst: Remove unused variables
Avoid that building scst with W=1 triggers compiler warnings about
variables that are set but not used. See also the documentation of
the gcc compiler flag -Wunused-but-set-variable.

This patch does not change any functionality.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5585 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 19:38:10 +00:00
Vladislav Bolkhovitin
c237fa24d9 scst: RHEL 5 build fix
Avoid that building the scst kernel module fails on RHEL 5 due to
a missing kvasprintf() implementation.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5584 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 19:33:18 +00:00
Bart Van Assche
27477a769b nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5583 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 15:41:01 +00:00
Bart Van Assche
08c5b47ce0 regression tests: Sort hash keys before comparing
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5582 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 15:27:48 +00:00
Bart Van Assche
730f2ee268 regression tests: Sync with a recent sysfs change
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5581 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 15:27:06 +00:00
Bart Van Assche
60a8326a28 ib_srpt: RHEL 5 build fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5579 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-11 10:02:15 +00:00
Bart Van Assche
a941f47817 ib_srpt: Make IB_EVENT_GID_CHANGE test independent of the OFED detection code
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5578 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-10 14:49:59 +00:00
Bart Van Assche
007e3dfbbf ib_srpt: Make the test for IB_EVENT_GID_CHANGE support more robust
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5577 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-10 14:16:14 +00:00
Bart Van Assche
003b0f46ac nightly build: Update kernel versions
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5575 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-07 10:46:49 +00:00
Vladislav Bolkhovitin
b27e4d04a3 Use limits.discard_zeroes_data to set LBPRZ
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5574 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-06 21:59:24 +00:00
Vladislav Bolkhovitin
97167af582 scst: Make lockdep_assert_held() easier to use
The lockdep_assert_held() macro is a convenient debugging tool.
However, it is inconvenient to surround each invocation of that
macro by an #ifdef/#endif pair. Hence make it easier to use this
macro with older kernel versions.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5573 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-06 03:26:55 +00:00
Vladislav Bolkhovitin
6dab45204c scst: Leave out FSF mail address
This avoids that the following checkpatch complaint is triggered:

Do not include the paragraph about writing to the Free Software Foundation's
mailing address from the sample GPL notice. The FSF has changed addresses in
the past, and may do so again. Linux already includes a copy of the GPL.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5572 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-06 03:24:03 +00:00
Vladislav Bolkhovitin
27fbb23518 nullio_exec_read(): Fix kunmap() argument
The argument of kunmap() is of type struct page *. Detected by smatch.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5571 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-06 03:22:14 +00:00
Vladislav Bolkhovitin
44d8f75edb scst_lib: Fix a compiler warning triggered by the WRITE SAME implementation
Avoid for release builds that the compiler reports that the variable
'ws_sg_cnt' is not used.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5570 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-06 03:20:26 +00:00
Bart Van Assche
375443a442 scst_vdisk: Fix a kernel version < 2.6.38 compiler warning
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5569 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-05 06:46:57 +00:00
Bart Van Assche
f2ba108911 scst_vdisk: Build fix for kernel versions <= 2.6.32
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5568 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-05 06:34:19 +00:00
Bart Van Assche
a7648c418e ib_srpt: Avoid triggering a SCSI command timeout after login
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5567 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-04 15:17:59 +00:00