Commit Graph

138 Commits

Author SHA1 Message Date
Vladislav Bolkhovitin
7bdc38faf2 The most recent version of the sparse static source code checking tool does
now report functions that are called with a lock held but that are missing
__acquires() and __releases() annotations. The patch below adds such
annotations and makes the following sparse warnings disappear:

drivers/scst/iscsi-scst/iscsi.c:2861:9: warning: context imbalance in 'iscsi_check_send_delayed_tm_resp' - unexpected unlock
drivers/scst/iscsi-scst/nthread.c:1614:17: warning: context imbalance in 'scst_do_job_wr' - unexpected unlock
drivers/scst/iscsi-scst/iscsi.c:2861:9: warning: context imbalance in 'iscsi_check_send_delayed_tm_resp' - unexpected unlock
drivers/scst/iscsi-scst/nthread.c:1614:17: warning: context imbalance in 'scst_do_job_wr' - unexpected unlock
drivers/scst/scst_local/scst_local.c:554:30: warning: context imbalance in 'scst_local_queuecommand' - unexpected unlock

The patch below has been tested by comparing the output of
"scripts/run-regression-tests 2.6.30.3" before and after the patch was applied.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@982 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-07-27 17:52:19 +00:00
Bart Van Assche
e564749845 Removed trailing whitespace.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@947 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-07-10 12:10:41 +00:00
Vladislav Bolkhovitin
63b86adb27 Fixes wrong usage of parent request's fields in the response.
Reported by Erez Zilber <erezzi.list@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@945 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-07-09 18:38:54 +00:00
Vladislav Bolkhovitin
37ba91d275 Update for 2.6.30
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@938 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-07-08 17:27:30 +00:00
Vladislav Bolkhovitin
fb0256ba8a Small performance optimization: wake up IO/processing threads in LIFO order.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@928 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-06-30 16:13:48 +00:00
Vladislav Bolkhovitin
1c304091f4 - Data digest SMP scalability imcreased
- Iscsi_dump_char() made thread safe



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@841 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-05-11 17:24:51 +00:00
Vladislav Bolkhovitin
f572d4ff79 - Copyrights updated.
- Other minor updates



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@803 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-04-27 19:01:28 +00:00
Vladislav Bolkhovitin
102603f46d We can't mark sess as shutting down in close_conn(), because at that time it might have pending commands. Otherwise, in case of reinstatement it might lead to data corruption, because commands in being reinstated session can be executed after commands in the new session.
Found out by Hari Subramanian <hari@vmware.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@792 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-04-21 18:25:46 +00:00
Vladislav Bolkhovitin
8c88994bb2 The patch below fixes recently introduced checkpatch complaints on whitespace
and also fixes two (false positive) sparse warnings about uninitialized variables.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@776 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-04-14 17:50:11 +00:00
Vladislav Bolkhovitin
7b30ca41cb - Now during connection and session reinstatements only SCSI commands are delayed until the corresponding reinstatement finished.
- TEST UNIT READY made HEAD OF QUEUE to let target don't look dead under high load
 - Docs updated



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@774 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-04-14 17:29:23 +00:00
Vladislav Bolkhovitin
bf4556ec1c A bunch of minor fixes and important cleanups. Particularly:
- More fixes on circular dependency between target_mutex and scst_mutex
 - Docs updated
 - Sense handling cleanups



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@764 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-04-09 10:07:31 +00:00
Vladislav Bolkhovitin
426234630f Missed bits in preventing circular locking dependency between target_mutex and scst_mutex
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@752 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-04-06 11:19:07 +00:00
Vladislav Bolkhovitin
e62b39196b Bidirectional data transfers added
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@744 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-04-03 17:49:26 +00:00
Vladislav Bolkhovitin
f8eebf8dd8 Fix for circular locking dependency between target_mutex and scst_mutex spotted by lockdep
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@743 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-04-03 17:38:20 +00:00
Vladislav Bolkhovitin
d121145099 Patch from Frank Zago fixing compilation on 2.6.23 kernel
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@734 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-04-02 18:16:11 +00:00
Vladislav Bolkhovitin
8ff3e56ef6 Fixes deadlock on iSCSI session freeing. Reported by andy yan <andyysj@gmail.com>
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@718 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-25 13:03:29 +00:00
Vladislav Bolkhovitin
bc96b052d5 The patch below adds support for the 2.6.29 kernel and also fixes the
checkpatch issues reported by the checkpatch script included with the 2.6.29
kernel and that were not yet reported by the 2.6.28 checkpatch script
(trailing statements should be on the next line / struct should normally be
const).
The patch below has been tested as follows:
- Reran scripts/run-regression-tests -k 2.6.24.7 -k 2.6.25.20 -k 2.6.26.8 -k 2.6.27.21 -k 2.6.28.9 -k 2.6.29 and verified the output.
- Rebuilt, installed and loaded scst, iscsi-scst and srpt as follows:
make -s clean && make -s -C scst install && make -s -C iscsi-scst install && make -s -C srpt install && cd scstadmin && make -s && make -s install && modprobe scst_vdisk && modprobe iscsi-scst && dmesg

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>

with minor cleanups and corrections in put_page_callback-2.6.29.patch



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@717 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-25 12:55:27 +00:00
Vladislav Bolkhovitin
2f9f473cde - Fixes broken build if io_context patch not applied
- #warning's cleanup



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@715 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-24 10:43:55 +00:00
Vladislav Bolkhovitin
9c552a9b60 The patch below fixes the following recently introduced checkpatch complaints:
* use tabs not spaces

and the following recently introduced sparse warnings:

* drivers/scst/scst_lib.c:437:6: warning: symbol 'scst_queue_report_luns_changed_UA' was not declared. Should it be static?
* drivers/scst/scst_lib.c:3909:21: warning: symbol 'tm_dbg_tgt_dev' was not declared. Should it be static?
* drivers/scst/iscsi-scst/session.c:170:9: warning: cast to non-scalar
* drivers/scst/iscsi-scst/session.c:180:24: warning: cast to non-scalar
The patch below has been verified by reviewing it carefully and by verifying the output of the following command: scripts/run-regression-tests -k 2.6.28.8

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@712 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-23 19:32:32 +00:00
Vladislav Bolkhovitin
177824fe91 Unsupported patch from Krzysztof Błaszkowski <kb@sysmikro.com.pl>:
I prepared it for kernel 2.6.27.7-9 which is used by openSuSE11.1-0 but it can 
also be applied to 2.6.27.19-3.2.1 (with some offset/fuzz) which is going to 
be deployed in SLE11.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@711 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-23 19:25:38 +00:00
Vladislav Bolkhovitin
94ae1d6db9 Fixes possible oopses on scst_cmd dereference.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@708 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-20 18:40:55 +00:00
Vladislav Bolkhovitin
27c5d8dcdf The patch below fixes the following recently introduced checkpatch complaints:
* use tabs not spaces
* Macros with complex values should be enclosed in parenthesis.
* printk() should include KERN_ facility level.
The patch below has been verified by reviewing it carefully and by verifying the output of the following command: scripts/run-regression-tests -k 2.6.28.8

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@707 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-20 12:36:01 +00:00
Vladislav Bolkhovitin
071e0a720c Support for descriptor sense format added
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@705 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-20 12:07:48 +00:00
Vladislav Bolkhovitin
341f592a4a Support for variable lenght CDB added
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@702 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-18 19:36:01 +00:00
Vladislav Bolkhovitin
159ef466dc - Support for SCSI AENs added
- Now sense data are sent without additional memory allocation and copy

 - Sending and receiving padding bytes reimplemented

 - Cleanups



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@699 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-17 18:05:19 +00:00
Vladislav Bolkhovitin
f9b9d824c6 Session and connection reinstation fixes for cases when they are shutting down and request for reinstation comes.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@692 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-06 19:04:48 +00:00
Vladislav Bolkhovitin
bda620b65a - Connection reinstatement fixes
- Minor cleanups



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@687 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-04 18:31:35 +00:00
Vladislav Bolkhovitin
bc7c69bfc4 - Fixed a major IET-derived iSCSI RFC violation: sessions and connections were not working
- A lot of cleanups and minor fixes, mostly IET-derived



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@685 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-03-03 18:13:23 +00:00
Vladislav Bolkhovitin
dd1400dddc The patch below adds the following two RHEL 5 / CentOS 5 patches to the SCST
source tree:
- Support for zero-copy TCP transfer completion.
- An implementation of scsi_execute_async_fifo().
Except for the hunk headers, these patches are identical to similarly named
patches already present in the SCST source tree.

Additionally, implementations of seq_list_start() and seq_list_next() are
provided for those kernel versions that do not define these functions.

The patch below has been tested by verifying that iSCSI data transfer still
works OK on CentOS 5.2 (x86_64).

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@657 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-02-02 11:36:53 +00:00
Vladislav Bolkhovitin
ae5ec143aa The patch below is a minor correction for the 2.6.27 in-tree kernel patches
I submitted about three months ago: the patch headers now refer to the 2.6.27
kernel as they should instead of the 2.6.26 kernel. At least one user has been
confused by this. The patch below does not change any behavior of SCST.
The patch has been tested by verifying that the output of the following
command remained the same as before the modifications:
scripts/run-regression-tests -k 2.6.27

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@656 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-02-02 11:29:14 +00:00
Vladislav Bolkhovitin
52d7752136 - Removed artificial limitation on sg_tablesize. It isn't needed, because the regular iSCSI negotiated MaxRecvDataSegmentLength-related facilities do all the job pretty well.
- Cleanups



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@655 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-02-02 11:16:38 +00:00
Vladislav Bolkhovitin
b240091109 Final merge with IET (r201-204):
- 2.6.25 introduced netlink_socket_release(), to be used to clean up netlink sockets correctly (taking care of namespaces).

 - New more scalable proc seq_file implementation

+ minor signess cleanups

+ version updated



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@654 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-01-30 17:47:31 +00:00
Vladislav Bolkhovitin
684719c66e Merge with IET r170-191:
- Update MaxConnections documentation
 - Remove isns config description from man page
 - Check return values of chdir(), ftruncate() and write(), because recent versions of the glibc insist on the return value being checked by
introducing __attribute__((warn_unused_result)) to these functions.
 - Fix snprintf use in isns.c
 - Take \0-termination into account when passing strings to isns_tlv_set() to solve incompatibility with MS iSNS 3.0 as IQN length is multiple of 4
 - Fix list corruption if SCST target registration fails
 - Register the target port actually used instead of the default iSCSI port.
 - Remove unused connection->pad
 - Refactor cmnd_execute()
 - Version changed



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@649 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-01-29 19:10:10 +00:00
Vladislav Bolkhovitin
ba698dbdd5 - Fix for iSCSI RFC violation: TARGET COLD RESET must close all connections/sessions, not only the current one
- Cleanups



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@648 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-01-29 18:25:45 +00:00
Vladislav Bolkhovitin
2482d19490 The patch below fixes most checkpatch and sparse issues that are reported by
the most recent versions (checkpatch 2.6.28 / latest sparse git version) and
that were not reported by previous versions (checkpatch 2.6.27 / sparse 0.4.1).
The patch below fixes the following issues:
* Removed trailing space in iscsi-scst/README_in-tree.
* Fixed sparse complaints about functions that were not declared static.
* Fixed sparse complaints about casts between address spaces: such casts are
   now either fixed or explicit (via the __force keyword).

The patch below has been verified by checking the output produced by:
scripts/run-regression-tests -k 2.6.28.1

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@641 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-01-26 17:32:50 +00:00
Vladislav Bolkhovitin
ae7345340c A bunch of minor fixes/improvements, cleanups and updates:
- In scst_local new experimental compile-time option to force direct processing added
 - Attempt in SCST structures to separate read-mostly from read-write data to decrease cache ping-pong between CPUs
 - In scst_vdisk new module parameter num_threads added to specify a number of threads for each vdisk/vcdrom. Default is 5.
 - Debug logging for failed digests in iSCSI-SCST improved
 - Docs updates/cleanups



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@635 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-01-16 20:56:06 +00:00
Vladislav Bolkhovitin
479a9d0a9f - Update for 2.6.28
- Small doc update in flow control area



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@632 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2009-01-12 18:55:08 +00:00
Vladislav Bolkhovitin
41c3515516 - Memory barriers cleanup. Comments for them improved
- Small docs update
 - srpt/README_in-tree added



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@614 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-12-10 10:55:01 +00:00
Vladislav Bolkhovitin
cba6490e82 Until now I had been using the latest git version of sparse (August 26, 2008).
Apparently not all messages reported by this version are correct. So I switched
back to the last released sparse version (0.4.1). The patch below fixes all
errors and warnings reported by sparse 0.4.1 on the SCST source code.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@596 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-12-04 18:00:51 +00:00
Vladislav Bolkhovitin
e7e7c386f9 Cleanups after "make namespacecheck"
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@593 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-12-03 11:59:41 +00:00
Vladislav Bolkhovitin
7f87aa16a3 Small docs update
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@589 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-11-29 17:00:15 +00:00
Vladislav Bolkhovitin
9013ab1315 Signed/unsigned cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@586 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-11-28 16:11:51 +00:00
Vladislav Bolkhovitin
ea7e57886e The patch below fixes the sparse warnings on passing a __user pointer where a
kernel pointer is expected and vice versa. Additionally, there are a few fixes
for checkpatch warnings on trailing whitespace and lines that were over 80
columns.

This patch has been verified by reviewing it carefully and by verifying the
output files of the command scripts/run-regression-tests -k 2.6.27.6.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@579 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-11-21 10:15:03 +00:00
Vladislav Bolkhovitin
e882fcec37 The patch below fixes sparse warnings about int / unsigned int mismatches in
the iscsi-scst source code.

This patch has been verified by reviewing it carefully and by verifying the
output files of the command scripts/run-regression-tests -k 2.6.27.6.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@571 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-11-18 18:23:08 +00:00
Vladislav Bolkhovitin
b0c6d9a561 The patch below fixes many checkpatch warnings triggered by the iSCSI kernel
code, mainly about lines that exceeded 80 columns. As you can see in the patch
below most lines that were too long have been split, but some code has also
been moved into helper functions in order to keep the code readable. No
functionality has been changed.

This patch has been verified as follows:
- Reread the patch carefully.
- Verified that the iSCSI target kernel module still loads.
- Verified the output generated by scripts/run-regression-tests -k 2.6.27.5.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>

with some modifications



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@569 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-11-12 18:49:18 +00:00
Vladislav Bolkhovitin
47422bf856 Added possibility to coexist if both target driver and dev handler need custom memory allocation. Direct consequences:
1. scst_local can work with scst_user's devices

2. scst_user now compatible with iscsi-scst if put_page_callback not applied

+ some cosmetics



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@567 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-11-11 11:56:18 +00:00
Vladislav Bolkhovitin
27dc521710 Cleanup: one more __GFP_NOFAIL removed
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@560 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-11-01 11:45:26 +00:00
Vladislav Bolkhovitin
90c831b838 Cleanup removing usage of in_atomic(). Particularly, now target drivers and dev handlers need to explicitly supply preferred execution context in scst_cmd_done() and scst_tgt_cmd_done().
WARNING! This commit changes external SCST interface, so it can break compilation of your out of SCST SVN tree target driver or dev handler. To fix it, simply supply the preferred exection context to scst_cmd_done() and/or scst_tgt_cmd_done().

Thanks to Bart Van Assche <bart.vanassche@gmail.com> for pointing on it.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@556 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-10-31 10:49:25 +00:00
Vladislav Bolkhovitin
fe84b1f26b The iscsi-scst kernel module does not get compiled even with CONFIG_SCST_ISCSI
set to m or y. The patch below fixes this.

This patch has been verified by rerunning scripts/run-regression-tests -k 2.6.27.3
and by verifying that the kernel build produced a iscsi-scst.ko kernel module.

Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@548 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-10-28 20:43:38 +00:00
Vladislav Bolkhovitin
3fc14278b5 Fixed accidentally enabled superfluous warnings.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@544 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2008-10-28 20:19:07 +00:00