Commit Graph

382 Commits

Author SHA1 Message Date
Vladislav Bolkhovitin
e565cbce6e Merged revisions 5955,5959-5961,5965 via svnmerge from
svn+ssh://vlnb@svn.code.sf.net/p/scst/svn/trunk

........
  r5955 | bvassche | 2014-12-22 05:10:41 -0800 (Mon, 22 Dec 2014) | 1 line
  
  Update for kernel 3.18
........
  r5959 | bvassche | 2015-01-06 05:25:28 -0800 (Tue, 06 Jan 2015) | 1 line
  
  scst_calc_block_shift: Log block shift and sector size upon mismatch
........
  r5960 | bvassche | 2015-01-07 01:20:06 -0800 (Wed, 07 Jan 2015) | 4 lines
  
  scst_local: Fix unique per session sas address
  
  Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
........
  r5961 | bvassche | 2015-01-09 04:23:25 -0800 (Fri, 09 Jan 2015) | 4 lines
  
  scst_sysfs: return EINVAL on too big LUN
  
  Signed-off-by: Sebastian Herbszt <herbszt@gmx.de>
........
  r5965 | bvassche | 2015-01-13 00:55:46 -0800 (Tue, 13 Jan 2015) | 68 lines
  
  qla2x00t: Copy entire SCST sense buffer to q2x ctio
  
  There seems to be a bug in passing sense information to QLA HBAs, where 
  the last 2 bytes of the sense data (ASC, ASCQ) are not copied to the low 
  level sense buffer.
  We encountered this in ESX, which relies on these 2 bytes to parse the 
  MISCOMPARE sense code (0xE1, 0x1D, 0x00).
  Bellow is a simple test to recreate this issue, but during vMotion 
  operations (where VMs are moved from one host to another), this may 
  cause the operation to fail leaving the VM in an inconsistent state.
  
  The test I ran to verify that we are indeed missing the bytes is the 
  following:
  1. Create a SCST based device
  2. Expose the device to 2 ESX hosts
  3. Format the device as VMFS5, create a test directory
  4. From both hosts, I start writing to this directory (no VMs involved, 
  just write normal files)
  
  At this stage, both ESX hosts try to take access to the directory.
  The VMFS filesystem contains a per-directory lock which is managed by 
  COMPARE AND WRITE command.
  Each ESX will attempt to change the VMFS lock location from unlocked to 
  locked to create the new file.
  
  Obviously there are bound to be failures (which are equivalent to 
  programming locking conflicts), these are reported by the MISCOMPARE 
  sense code.
  Upon these MISCOMPARE errors, the host will re-try taking the lock until 
  it succeeds, and will then proceed to perform the write operation on the 
  directory.
  
  Due to the bug in copying the sense buffer from the SCST core to the QLA 
  ctio, instead of the full sense code, only the key (0xE) is sent, and 
  ESX does not know how to handle it resulting in IO error.
  
  Here are the errors as they appear on the command line:
  /vmfs/volumes/54a297c4-ca5af1cc-7f94-002219d20f28/ats_test # 
  ./open_close_test-esx2.sh
  ./open_close_test-esx2.sh: line 8: can't create 
  ats_fileoptest-esx2_1.txt: Input/output error
  ./open_close_test-esx2.sh: line 8: can't create 
  ats_fileoptest-esx2_21.txt: Input/output error
  ./open_close_test-esx2.sh: line 8: can't create 
  ats_fileoptest-esx2_110.txt: Input/output error
  ./open_close_test-esx2.sh: line 8: can't create 
  ats_fileoptest-esx2_111.txt: Input/output error
  
  In the /var/log/vmkernel.log, we can see that the sense information is 
  missing (0xE, 0x0, 0x0) instead of (0xE, 0x1D, 0x0).
  2014-12-30T12:13:20.714Z cpu6:33519)ScsiDeviceIO: 2338: 
  Cmd(0x412e84f957c0) 0x89, CmdSN 0x234d from world 519051 to dev 
  "eui.0024f400d5020007" failed H:0x0 D:0x2 P:0x0 Valid sense data: 0xe 0x0 0x0.
  2014-12-30T12:13:20.766Z cpu6:33519)ScsiDeviceIO: 2338: 
  Cmd(0x412e84f91d00) 0x89, CmdSN 0x2350 from world 519051 to dev 
  "eui.0024f400d5020007" failed H:0x0 D:0x2 P:0x0 Valid sense data: 0xe 0x0 0x0.
  2014-12-30T12:13:20.766Z cpu6:33519)ScsiDeviceIO: 2338: 
  Cmd(0x412e80449fc0) 0x89, CmdSN 0x234f from world 519051 to dev 
  "eui.0024f400d5020007" failed H:0x0 D:0x2 P:0x0 Valid sense data: 0xe 0x0 0x0.
  
  This patch fixes this issue, the test will run without a problem with the
  fix (no IO errors, all the files are properly written to the directory).
  
  Signed-off-by: Shahar Salzman <shahar.salzman@kaminario.com>
  Reviewed-by: Eran Mann <eran.mann@kaminario.com>
  [bvanassche: simplified implementation]
  Signed-off-by: Bart Van Assche <bvanassche@acm.org>
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@6110 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2015-02-21 04:10:37 +00:00
Bart Van Assche
808301be78 iscsi-scst/kernel/patches/rhel/put_page_callback-2.6.32-504.patch: Add (merge r5904 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5915 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-05 10:01:49 +00:00
Bart Van Assche
c9100494b4 Update for kernel 3.17 (merge r5882 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5906 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-12-03 17:12:20 +00:00
Vladislav Bolkhovitin
f58278a211 Merged revisions 5856 via svnmerge from
svn+ssh://vlnb@svn.code.sf.net/p/scst/svn/trunk

........
  r5856 | vlnb | 2014-11-14 17:55:27 -0800 (Fri, 14 Nov 2014) | 3 lines
  
  Report RX data digest failures by default
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5858 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-11-15 05:38:28 +00:00
Bart Van Assche
14187b9810 Add support for the RHEL 7 kernel (merge r5710:5711 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5774 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-09-04 13:29:18 +00:00
Bart Van Assche
2c9cfa303c iscsi-scst: Micro-optimize cmnd_prepare_recv_pdu() (merge r5735 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5771 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-09-04 13:06:38 +00:00
Bart Van Assche
4513e2441b iscsi-scst: Build fix for IPV6=n (merge r5732 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5770 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-09-04 13:02:42 +00:00
Bart Van Assche
03c07d835c Update for kernel 3.16 (merge r5717 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5766 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-09-03 14:27:09 +00:00
Vladislav Bolkhovitin
9256821943 Merged revisions 5721 via svnmerge from
svn+ssh://vlnb@svn.code.sf.net/p/scst/svn/trunk

........
  r5721 | vlnb | 2014-08-20 22:17:47 -0700 (Wed, 20 Aug 2014) | 5 lines
  
  Fix incorrect address computation during receive PDUs preparations
  
  Found and fix suggested by Кирилл Тюшев <kirill.tyushev8@gmail.com>
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5723 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-08-21 05:21:55 +00:00
Bart Van Assche
3f77595dbd Change BUG_ON(1) into BUG() (merge r5618 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5695 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-07-20 06:52:12 +00:00
Bart Van Assche
cb4fa8ed0d scst: Make lockdep_assert_held() easier to use (merge r5573 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5693 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-07-20 06:46:28 +00:00
Bart Van Assche
91c8d27db8 iscsi-scst: Handle data buffers with non-zero offset correctly (merge r5683 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5687 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-07-20 05:59:31 +00:00
Bart Van Assche
42137a23c2 scst: Switch from the cpu_*() to the cpumask_*() API (merge r5596 from trunk)
git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5646 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-29 06:10:22 +00:00
Vladislav Bolkhovitin
e585dbc244 Merged revisions 5610 via svnmerge from
svn+ssh://vlnb@svn.code.sf.net/p/scst/svn/trunk

........
  r5610 | vlnb | 2014-06-18 20:51:48 -0700 (Wed, 18 Jun 2014) | 3 lines
  
  Update for 3.15 kernels
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5623 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-25 04:00:14 +00:00
Vladislav Bolkhovitin
f7bd8e034b Merged revisions 5543,5545 via svnmerge from
svn+ssh://vlnb@svn.code.sf.net/p/scst/svn/trunk

........
  r5543 | bvassche | 2014-05-23 00:33:53 -0700 (Fri, 23 May 2014) | 1 line
  
  RHEL 7 build fixes
........
  r5545 | bvassche | 2014-05-23 01:36:36 -0700 (Fri, 23 May 2014) | 1 line
  
  scripts/rebuild-rhel-kernel-rpm: Add RHEL 7 RC support
........


git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/3.0.x@5565 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-06-04 03:12:05 +00:00
Vladislav Bolkhovitin
416958ee4b iscsi-scst: One major number per thread pool
Assign one major number per thread pool instead of as many major
numbers as there are threads in a thread pool. Do not increment
'major' if thread pool allocation fails. Micro-optimize
iscsi_threads_pool_get() by eliminating the assignment to 'fn'
and the write via snprintf() into name[].

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5520 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-05-15 01:39:12 +00:00
Vladislav Bolkhovitin
8d4a2f0a49 Cleanups and logging improvements
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5503 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-05-06 23:22:32 +00:00
Bart Van Assche
cbc9df8306 iscsi-scst/kernel/patches/put_page_callback-3.2.57.patch: Add
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5450 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-20 06:24:23 +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
bbdf791c65 Update to kernels 3.14
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5432 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-04-18 00:32:51 +00:00
Vladislav Bolkhovitin
8599ec4452 Reimplement dropping of TM requests in a more reliable manner
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5395 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-26 23:51:36 +00:00
Vladislav Bolkhovitin
0c66b8aaf7 iscsi-scst: Introduce ARRAY_SIZE()
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@5386 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-03-26 03:21:25 +00:00
Bart Van Assche
cbb8071e73 put_page_callback-3.10.30.patch: Add
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5310 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-25 10:57:27 +00:00
Bart Van Assche
493f498b7b put_page_callback-3.12.11.patch: Add
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5309 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-25 10:55:36 +00:00
Vladislav Bolkhovitin
9ab22a69fd put_page_callback patch for 3.13.3+ kernels
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5296 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-20 05:54:49 +00:00
Vladislav Bolkhovitin
b4ba1b24c7 iscsi-scst: fix offset calculation
Fixed a subtle bug in iSCSI-SCST with incorrectly calculated offsets
for non-page aligned transfers. Originally discovered, investigated and
fix suggested by Кирилл Тюшев, then Shahar Salzman tested and proved it.
See http://sourceforge.net/mailarchive/message.php?msg_id=31924078



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5281 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-02-13 04:02:56 +00:00
Vladislav Bolkhovitin
e6fd59bda4 Update for 3.13 kernels
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5250 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2014-01-30 02:32:44 +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
1e897454b2 iscsi-scst/kernel/patches/rhel/put_page_callback-2.6.32-431.patch: put_page_callback patch for RHEL 6.5
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5171 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-12-22 10:02:54 +00:00
Vladislav Bolkhovitin
60d49c8451 Update for kernel 3.12
May be not completed, because this kernel has too many internal issues
reported after enabling "Kernel hacking" config options



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5163 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-12-19 05:15:48 +00:00
Bart Van Assche
7a82927e0a scripts/rebuild-rhel-kernel-rpm: Add RHEL 6.4 support
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5162 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-12-18 16:23:34 +00:00
Vladislav Bolkhovitin
81349d12a7 scst: Kernel >= 3.10 procfs build fix
The following procfs-related changes have been included in kernel 3.10:
- The PDE() macro has been removed from <linux/proc_fs.h>.
- The create_proc_entry() function has been removed.
- The proc_info field has been removed from struct scsi_host_template.

Unbreak the procfs build for kernel versions >= 3.10



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5148 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-12-18 05:58:09 +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
10840a381f A problem we are hitting is that we could hit a network issue
when a command/data is in the process of being sent. The snd
buffer space goes to zero and sendpage returns -EAGAIN. We then
wait for space to open. If space never opens then the cmd rsp timer
fires and the session/connection is dropped.

During that time we could try to send a nop as a ping, but it
is stuck behind that other command that got EAGAIN and we are
waiting for space to open to send them. We would expect the
nop in timer to fire before the cmd rsp timer, but it cannot
becuase the nop is sitting in the internal iscsi-scst queue.

This patch just has us start the timer ont he nop in right
away.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5091 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-09 03:02:59 +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
b96ab2a8bf iscsi-scst: Fix a race condition triggered by logout
This patch fixes the following crash:

general protection fault: 0000 [#1] PREEMPT SMP
Modules linked in: scst_local(O) iscsi_scst(O) scst_vdisk(O) libcrc32c scst(O) brd netconsole target_core_mod configfs fcoe libfcoe libfc scsi_transport_fc scsi_tgt ib_iser rdma_cm ib_addr iw_cm ib_cm ib_sa ib_mad ib_core iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi aesni_intel aes_x86_64 glue_he
lper parport_pc ppdev lrw gf128mul ablk_helper cryptd joydev microcode mperf psmouse i2c_piix4 processor button intel_agp intel_gtt agpgart lp parport hid_generic usbhid hid ext4 jbd2 mbcache floppy ata_piix
CPU: 0 PID: 7735 Comm: iscsiwr3 Tainted: G           O 3.11.0-debug+ #1
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
task: ffff88000850cfc0 ti: ffff88002ea5c000 task.ti: ffff88002ea5c000
RIP: 0010:[<ffffffffa038dd7b>]  [<ffffffffa038dd7b>] target_del_all_sess+0x9b/0x180 [iscsi_scst]
RSP: 0018:ffff88002ea5dcc0  EFLAGS: 00010286
RAX: 00000000fffffffe RBX: dead0000000fefc0 RCX: 0000000000000001
RDX: ffff88000e609460 RSI: 001e00004f011780 RDI: ffff88000e609460
RBP: ffff88002ea5dce8 R08: 0000000000000001 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000000 R12: ffff88000e6093b0
R13: ffff88000e609460 R14: 0000000000000000 R15: ffff88003e948158
FS:  0000000000000000(0000) GS:ffff88000f800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000000427248 CR3: 0000000036d64000 CR4: 00000000000407f0
Stack:
 ffff88000e6093b0 ffff88003e85d600 ffff88003e948000 0000000000000030
 0000000000000000 ffff88002ea5dd28 ffffffffa038002b 0000000000000001
 ffff88003e55f880 ffff88002ea5dd28 ffffffffa0384d13 ffff88003e948000
Call Trace:
 [<ffffffffa038002b>] cmnd_tx_end+0x1db/0x1e0 [iscsi_scst]
 [<ffffffffa0384d13>] ? iscsi_do_send+0x23/0x60 [iscsi_scst]
 [<ffffffffa0385021>] iscsi_send+0x2d1/0x480 [iscsi_scst]
 [<ffffffff8104a802>] ? local_bh_enable_ip+0x82/0x110
 [<ffffffffa0380e8f>] ? conn_get+0x1f/0x70 [iscsi_scst]
 [<ffffffffa0385290>] scst_do_job_wr+0xc0/0x2d0 [iscsi_scst]
 [<ffffffffa038560d>] istwr+0x16d/0x2e0 [iscsi_scst]
 [<ffffffff8106a2e0>] ? wake_up_bit+0x40/0x40
 [<ffffffffa03854a0>] ? scst_do_job_wr+0x2d0/0x2d0 [iscsi_scst]
 [<ffffffff81069ea6>] kthread+0xd6/0xe0
 [<ffffffff81069dd0>] ? kthread_create_on_node+0x110/0x110
 [<ffffffff814debfc>] ret_from_fork+0x7c/0xb0
Code: 00 00 49 8b 94 24 b0 00 00 00 48 8b 1a 48 8d b2 c0 ee ff ff 48 81 eb 40 11 00 00 49 39 d5 74 28 44 89 f2 4c 89 e7 e8 15 fd ff ff <48> 8b 8b 40 11 00 00 48 89 de 48 8d 93 40 11 00 00 49 39 d5 48
[  474.156827] RIP  [<ffffffffa038dd7b>] target_del_all_sess+0x9b/0x180 [iscsi_scst]
 RSP <ffff88002ea5dcc0>

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5019 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-03 05:04:15 +00:00
Vladislav Bolkhovitin
844e194647 Update for kernels 3.11.x
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5004 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-09-28 04:23:45 +00:00
Vladislav Bolkhovitin
719b8be3f7 Fix incorrect logging of negotiated data digest
Reported by Klaus Hochlehnert <Mailings@kh-dev.de>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5003 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-09-28 04:04:47 +00:00
Bart Van Assche
75f9be4b34 iscsi-scst: Spelling fix - change dublicate into duplicate
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4926 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-07-29 10:43:00 +00:00
Vladislav Bolkhovitin
2e9540c902 Update for kernel 3.10
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4921 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-07-25 23:38:31 +00:00
Bart Van Assche
88ae3b7c78 iSCSI-SCST: Fix a sparse warning introduced via r4852
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4854 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-18 15:48:17 +00:00
Vladislav Bolkhovitin
9b674796d6 Update to kernel 3.9
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4853 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-18 03:41:04 +00:00