Bart Van Assche
904b3c1eb3
iscsi-scst: Kernel 3.19 build fix
...
Change the data type of iscsi_conn.read_iov into struct kvec * and
switch from iscsi_conn.read_size to iscsi_conn.read_msg.count for
kernel version 3.19 and later. Cast the return type of
get_zeroed_page() to void * since with this patch the read_iov
data type depends on the kernel version. Remove the (void __force
__user *) casts when assigning to iov_base since for a kvec iov_base
is a kernel pointer instead of a user space pointer. Switch to
iov_iter_kvec() to initialize conn->read_msg.msg_iter.
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com >
2015-04-13 18:44:00 +02:00
Vladislav Bolkhovitin
fe38e4acb2
Copyrights updated
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6146 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-03-19 00:01:03 +00:00
Bart Van Assche
5019ae319e
scst: Introduce file_inode()
...
Signed-off-by: Sebastian Herbszt <herbszt@gmx.de >
[bvanassche: Constified file_inode() argument / added iscsi-scst conversion]
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6084 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-12 07:48:10 +00:00
Bart Van Assche
9707f85c0b
Fix kernel 3.17 checkpatch warnings about 'long long unsigned'
...
Avoid that checkpatch reports the following warning:
WARNING: type 'long long unsigned' should be specified in 'unsigned long long' order.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5885 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-11-26 08:16:44 +00:00
Vladislav Bolkhovitin
87c6bba994
iscsi-scst: Build fix for IPV6=n
...
Ensure that iscsi-scst builds properly against a kernel with CONFIG_IPV6=n.
Reported by Igor Novgorodov <igor@novg.net > on June 7, 2014.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5732 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-08-27 02:41:40 +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
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
Bart Van Assche
0880cbf0cf
RHEL 7 build fixes
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5543 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-05-23 07:33:53 +00:00
Bart Van Assche
135be0f19d
iscsi-scst: Fix a checkpatch warning
...
Fix the following checkpatch 3.14 warning:
Unnecessary parentheses - maybe == should be = ?
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5435 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 05:56:35 +00:00
Vladislav Bolkhovitin
00851a7501
Merge of adding iSER web page and copyright updates from the iSER branch
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5241 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-28 05:17:26 +00:00
Vladislav Bolkhovitin
85ea152e0c
[PATCH] scst: Remove casts from INIT_DELAYED_WORK() statements
...
This is a source code cleanup patch that 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@5221 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-22 02:57:49 +00:00
Bart Van Assche
53c344a10e
iscsi-scst: Kernel 3.13 build fix
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5182 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-02 17:20:00 +00:00
Bart Van Assche
9292161192
scst and iscsi-scst: Suppress two sparse complaints
...
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
2013-11-14 09:10:51 +00:00
Bart Van Assche
1d0efdeea9
iscsi-scst: Procfs build fix for r5101
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5109 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-14 08:50:29 +00:00
Vladislav Bolkhovitin
65d1b76e50
iscsi-scst: Make locking requirements explicit
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5101 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-13 04:51:05 +00:00
Bart Van Assche
2fa0405930
iscsi-scst: Build fix for non-debug kernels (follow-up for r5095)
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5100 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-12 08:22:39 +00:00
Vladislav Bolkhovitin
62fffa45dc
scst_sysfs: Trigger a lockdep complaint if sysfs work
...
could trigger a deadlock
This patch causes lockdep to complain if sysfs work could trigger a deadlock.
As an example, for the patch below the following lockdep complaint is generated:
======================================================
[ INFO: possible circular locking dependency detected ]
3.12.0-rc7-dbg+ #5 Tainted: GF O
-------------------------------------------------------
scst_mgmtd/7527 is trying to acquire lock:
(scst_tgt_dev){+.+.+.}, at: [<ffffffffa01f9365>] scst_tgt_dev_sysfs_del+0x105/0x1a0 [scst]
but task is already holding lock:
(&scst_mutex){+.+.+.}, at: [<ffffffffa01eaa46>] scst_free_session+0x56/0x2c0 [scst]
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #1 (&scst_mutex){+.+.+.}:
[<ffffffff810be983>] lock_acquire+0x93/0x150
[<ffffffff81619617>] mutex_lock_interruptible_nested+0x77/0x500
[<ffffffffa01f1f9f>] scst_tgt_dev_process_thread_pid_show+0x5f/0x120 [scst]
[<ffffffffa01f38d6>] scst_process_sysfs_works+0xe6/0x1d0 [scst]
[<ffffffffa01f7af0>] sysfs_work_thread_fn+0x120/0x2b0 [scst]
[<ffffffff8107482a>] kthread+0xea/0xf0
[<ffffffff81625f6c>] ret_from_fork+0x7c/0xb0
-> #0 (scst_tgt_dev){+.+.+.}:
[<ffffffff810bdc8a>] __lock_acquire+0x14fa/0x1a60
[<ffffffff810be983>] lock_acquire+0x93/0x150
[<ffffffffa01f20df>] scst_kobject_put_and_wait+0x6f/0x140 [scst]
[<ffffffffa01f9365>] scst_tgt_dev_sysfs_del+0x105/0x1a0 [scst]
[<ffffffffa01e9114>] scst_free_tgt_dev+0x84/0x210 [scst]
[<ffffffffa01ea80b>] scst_sess_free_tgt_devs+0x6b/0x100 [scst]
[<ffffffffa01eaa4e>] scst_free_session+0x5e/0x2c0 [scst]
[<ffffffffa01ead4e>] scst_free_session_callback+0x9e/0x170 [scst]
[<ffffffffa01d5a9a>] scst_global_mgmt_thread+0x24a/0x550 [scst]
[<ffffffff8107482a>] kthread+0xea/0xf0
[<ffffffff81625f6c>] ret_from_fork+0x7c/0xb0
other info that might help us debug this:
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
lock(&scst_mutex);
lock(scst_tgt_dev);
lock(&scst_mutex);
lock(scst_tgt_dev);
*** DEADLOCK ***
1 lock held by scst_mgmtd/7527:
#0 : (&scst_mutex){+.+.+.}, at: [<ffffffffa01eaa46>] scst_free_session+0x56/0x2c0 [scst]
stack backtrace:
CPU: 1 PID: 7527 Comm: scst_mgmtd Tainted: GF O 3.12.0-rc7-dbg+ #5
Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013
ffffffff822efd40 ffff88007b7c1ac8 ffffffff8161464a ffffffff822efd40
ffff88007b7c1b08 ffffffff81610d02 ffff88007b7c1b60 ffff8800692748c0
0000000000000000 ffff880069274898 ffff880069274120 ffff8800692748c0
Call Trace:
[<ffffffff8161464a>] dump_stack+0x4e/0x82
[<ffffffff81610d02>] print_circular_bug+0x201/0x210
[<ffffffff810bdc8a>] __lock_acquire+0x14fa/0x1a60
[<ffffffff810be983>] lock_acquire+0x93/0x150
[<ffffffffa01f9365>] ? scst_tgt_dev_sysfs_del+0x105/0x1a0 [scst]
[<ffffffffa01f20df>] scst_kobject_put_and_wait+0x6f/0x140 [scst]
[<ffffffffa01f9365>] ? scst_tgt_dev_sysfs_del+0x105/0x1a0 [scst]
[<ffffffffa01f9365>] scst_tgt_dev_sysfs_del+0x105/0x1a0 [scst]
[<ffffffffa01e9114>] scst_free_tgt_dev+0x84/0x210 [scst]
[<ffffffffa01ea80b>] scst_sess_free_tgt_devs+0x6b/0x100 [scst]
[<ffffffffa01eaa4e>] scst_free_session+0x5e/0x2c0 [scst]
[<ffffffffa01ead4e>] scst_free_session_callback+0x9e/0x170 [scst]
[<ffffffffa01d5a9a>] scst_global_mgmt_thread+0x24a/0x550 [scst]
[<ffffffff81075850>] ? wake_up_atomic_t+0x30/0x30
[<ffffffffa01d5850>] ? scst_register_session_non_gpl+0x20/0x20 [scst]
[<ffffffff8107482a>] kthread+0xea/0xf0
[<ffffffff81074740>] ? kthread_create_on_node+0x140/0x140
[<ffffffff81625f6c>] ret_from_fork+0x7c/0xb0
[<ffffffff81074740>] ? kthread_create_on_node+0x140/0x140
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5095 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-09 07:40:09 +00:00
Vladislav Bolkhovitin
13ee8e1649
We were setting the next timeout check to be the current time plus
...
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
2013-11-09 03:19:33 +00:00
Vladislav Bolkhovitin
1f4f117f3f
This patch fixes 2 issues.
...
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
2013-11-09 03:10:38 +00:00
Vladislav Bolkhovitin
2d874f7cb8
scst_sysfs: Introduce scst_kobject_put_and_wait()
...
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
2013-10-31 04:44:52 +00:00
Vladislav Bolkhovitin
2cadcc2c64
Cache alignment review
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4809 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-03-23 01:38:31 +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
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
ddae1f7a63
Fix incorrect duplicate connection sysfs entry detection
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4680 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-04 03:08:29 +00:00
Vladislav Bolkhovitin
a698883844
Switch to the new and preferred approach for printing kernel messages
...
From: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4558 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-10 03:01:34 +00:00
Vladislav Bolkhovitin
eb95049061
Copyrights updated + cleanups
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4216 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-18 02:26:39 +00:00
Vladislav Bolkhovitin
7872837b6b
Replace list_entry((a)->next, b, c) by list_first_entry(a, b, c).
...
BSD-signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3965 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-12-10 03:50:24 +00:00
Vladislav Bolkhovitin
c54ebba11a
Some more TM cleanups/improvements
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3460 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-05-18 21:45:09 +00:00
Vladislav Bolkhovitin
5e7544e5a4
TM handling fixes, part2, hopefully, final.
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3450 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-05-12 01:31:01 +00:00
Vladislav Bolkhovitin
70eb596f60
Rework iSCSI aborts to make them more correct and remove recent workarounds (one more post-IET cleanup)
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3444 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-05-09 23:07:23 +00:00
Vladislav Bolkhovitin
8443ae6bc7
Don't abort not yet received commands
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3425 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-04-29 19:54:13 +00:00
Vladislav Bolkhovitin
3c59daab2a
Correctly process being read cmd during abort
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3413 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-04-26 00:04:01 +00:00
Vladislav Bolkhovitin
64065a21e9
NOP-In/response timeouts improvements
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3411 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-04-25 23:50:49 +00:00
Vladislav Bolkhovitin
f3238333dd
Copyrights updated
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@3200 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2011-01-06 20:02:04 +00:00
Vladislav Bolkhovitin
52820b5d57
Cleanup
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2720 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-11-17 11:40:08 +00:00
Vladislav Bolkhovitin
12f4f75a81
Update for 2.6.36 based on patch from Bart Van Assche <bvanassche@acm.org>
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2470 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-10-26 12:30:40 +00:00
Vladislav Bolkhovitin
ff2c24c1c3
Assigning CPU affinity to threads and connections
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2317 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-30 18:07:27 +00:00
Vladislav Bolkhovitin
3c902f9a48
Fixes race between cancel_delayed_work_sync() and conn_nop_in_delayed_work_fn() restarting the work despite of the cancel. Reported by Phil White <phil@philwhite.org>
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2054 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-09-04 17:35:45 +00:00
Vladislav Bolkhovitin
1607d12c9c
Sysfs cleanups and fixes, part 1
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1962 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-08-20 15:38:21 +00:00
Vladislav Bolkhovitin
7eddeb82ab
- Some iSCSI performance fixes
...
- __attribute__((aligned(sizeof(long))) added to all field with different protection than the previous field to make sure they don't share the same bus line. Just in case, actually, compiler should do the alignment by default.
- Small docs updates.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1948 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-08-13 18:12:45 +00:00
Vladislav Bolkhovitin
459f589b34
- Delivery error response (instead of dropping connection) fixed
...
- Race when target deleted before the session(s) removal event(s) processed fixed
- Docs updated
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1733 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-06-01 18:28:41 +00:00
Vladislav Bolkhovitin
b53e4cb4c1
Merge of the pr branch with additional fixes for problems found during extra testing
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1714 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-05-26 17:46:46 +00:00
Vladislav Bolkhovitin
f025190b53
- Loosly merge of IET r271: fix connection and session leak on connection preparation stages
...
- Cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1645 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-21 22:17:43 +00:00
Vladislav Bolkhovitin
23ab28dcc7
Fix preliminary completion of reinstatement pending commands.
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1624 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-15 19:51:31 +00:00
Vladislav Bolkhovitin
4d5aaf047b
Copyrights updated
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1585 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-04-06 08:57:48 +00:00
Vladislav Bolkhovitin
1f216064f3
Uniform max queue depth handling in iSCSI
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1556 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-18 11:44:39 +00:00
Vladislav Bolkhovitin
88e5601df0
Deeply reworked patch from Alexey Obitotskiy <alexeyo1@open-e.com> implementing support for sending NOP-In requests
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1533 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-05 12:56:20 +00:00
Vladislav Bolkhovitin
9c02ed26c7
Update for 2.6.33
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1524 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-03-01 15:56:31 +00:00
Vladislav Bolkhovitin
713410951b
Minor fixes and cleanups
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1520 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-25 13:37:56 +00:00
Vladislav Bolkhovitin
4d96089e50
Sysfs interface for targets made uniform. ISCSI-SCST made confirming the uniformity requirements. See README for details.
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1511 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2010-02-17 19:07:54 +00:00