Bart Van Assche
886ae66326
fcst: Avoid triggering CRC errors at the initiator side
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4969 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:43:56 +00:00
Bart Van Assche
80ba881d46
fcst: Fix ft_abort_cmd()
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4968 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:43:26 +00:00
Bart Van Assche
e6610624ae
fcst: Report FC send errors
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4967 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:41:38 +00:00
Bart Van Assche
6c5328df1d
fcst: Use proper length variable for bidir commands in ft_recv_write_data()
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4966 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:41:17 +00:00
Bart Van Assche
76cc1e8857
fcst: Always report FC exchange errors
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4965 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:40:34 +00:00
Bart Van Assche
c71c844c21
fcst: Eliminate ft_cmd.serial
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4964 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:40:00 +00:00
Bart Van Assche
07569ed62d
fcst: Micro-optimize ft_cmd_free()
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4963 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:39:37 +00:00
Bart Van Assche
2381497291
fcst: Suppress a lockdep complaint
...
===============================
[ INFO: suspicious RCU usage. ]
3.10.0-rc1-debug+ #1 Tainted: G O
-------------------------------
fcst/ft_sess.c:194 suspicious rcu_dereference_protected() usage!
other info that might help us debug this:
rcu_scheduler_active = 1, debug_locks = 0
1 lock held by fcoethread/2/7942:
#0 : (rcu_read_lock){.+.+..}, at: [<ffffffffa035ee30>] rcu_lock_acquire.constprop.14+0x0/0x30 [fcst]
stack backtrace:
CPU: 2 PID: 7942 Comm: fcoethread/2 Tainted: G O 3.10.0-rc1-debug+ #1
Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
0000000000000001 ffff88003b191c28 ffffffff81525a11 ffff88003b191c58
ffffffff810a20ad ffff880039b7d1e8 ffff88003690c400 000000000000067a
ffff880039b7cb88 ffff88003b191c80 ffffffffa035f67b ffff880039b7cb88
Call Trace:
[<ffffffff81525a11>] dump_stack+0x19/0x1b
[<ffffffff810a20ad>] lockdep_rcu_suspicious+0xfd/0x130
[<ffffffffa035f67b>] ft_sess_get.isra.7+0x12b/0x150 [fcst]
[<ffffffffa035f6e2>] ft_recv+0x42/0x100 [fcst]
[<ffffffffa026edb2>] fc_lport_recv_req+0x272/0x2f0 [libfc]
[<ffffffffa0268c3b>] fc_exch_recv+0x61b/0xdc0 [libfc]
[<ffffffffa025f306>] fcoe_percpu_receive_thread+0x386/0x5f0 [fcoe]
[<ffffffff8106d34b>] kthread+0xdb/0xe0
[<ffffffff815357ac>] ret_from_fork+0x7c/0xb0
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4962 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:39:14 +00:00
Bart Van Assche
e506bd990d
fcst: Fix a race condition
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4961 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:37:45 +00:00
Bart Van Assche
e41c3bf328
fcst: Fix a lockdep warning
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4960 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:37:23 +00:00
Bart Van Assche
cf8d18cba8
fcst: Remove ft_prlo() function header and a comment
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4959 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:37:00 +00:00
Bart Van Assche
049aab6dce
fcst: Update a debug statement in ft_prli()
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4958 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:36:32 +00:00
Bart Van Assche
62059912bf
fcst: Remove two comments from ft_prli_locked()
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4957 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:36:08 +00:00
Bart Van Assche
50c4c8ded9
fcst: Remove superfluous initialization from ft_sess_get()
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4956 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:35:45 +00:00
Bart Van Assche
5fd500a4e9
fcst: Include version number in module description
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4955 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:35:09 +00:00
Bart Van Assche
812c33d403
fcst: Update ft_send_resp_code() function header
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4954 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:34:43 +00:00
Bart Van Assche
54b4717ffa
fcst: Inline ft_send_xfer_rdy_off()
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4953 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:34:19 +00:00
Bart Van Assche
c555196073
fcst: Update ft_send_response() comment header
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4952 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:33:51 +00:00
Bart Van Assche
c2cbc9fec7
fcst: Move a member variable in struct ft_sess
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4951 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:33:18 +00:00
Bart Van Assche
a578373d4e
fcst: Add more debugging code in ft_sess_put()
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4950 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-13 18:32:41 +00:00
Bart Van Assche
08afc26627
fcst: Do not define kref_get_unless_zero() if backported through stable tree
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4934 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-03 18:06:32 +00:00
Bart Van Assche
1b94eecde7
fcst: Revert r4889 because it was wrong
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4931 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-08-03 15:14:19 +00:00
Bart Van Assche
067a3231f9
fcst: Fix a checkpatch complaint about whitespace
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4893 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-06-04 11:46:22 +00:00
Bart Van Assche
fda521f287
fcst: Follow-up for r4873
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4889 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-06-04 09:41:58 +00:00
Bart Van Assche
095813cc56
fcst: RHEL 6 build fix
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4886 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-06-03 15:41:09 +00:00
Bart Van Assche
b0133418e3
fcst: Fix a bug in a pre-2.6.36 error path. This was spotted by both sparse and smatch.
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4873 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-21 18:18:37 +00:00
Bart Van Assche
88762d3574
fcst: Fix WRITE SAME handling
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4872 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-20 18:35:24 +00:00
Bart Van Assche
33c0e52b93
fcst: Fix two sparse warnings
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4870 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-20 06:39:24 +00:00
Bart Van Assche
8c3fc40784
fcst: Fix build on pre-2.6.36 kernels
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4869 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-20 06:37:55 +00:00
Bart Van Assche
2c01ef207f
fcst: Avoid invoking ft_cmd_done(NULL)
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4867 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-19 18:10:20 +00:00
Bart Van Assche
aec51e803c
fcst: Kernel 3.9 build fix
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4866 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-19 16:58:52 +00:00
Bart Van Assche
1ed1f3fda7
fcst: Eliminate ft_sess_lookup_delete()
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4865 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-19 16:57:57 +00:00
Bart Van Assche
c4b720647c
fcst: Move the ft_prov data structure
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4864 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-19 16:56:42 +00:00
Bart Van Assche
06141fe25d
fcst: Minimize comment diffs with upstream
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4863 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-19 16:54:34 +00:00
Bart Van Assche
f5fd68200e
fcst: Introduce function ft_sess_hash()
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4862 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-19 16:53:24 +00:00
Bart Van Assche
55084ba194
fcst: Minimize diffs of ft_send_read_data() and ft_recv_write_data() with upstream
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4861 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-19 16:51:52 +00:00
Bart Van Assche
58aceecbff
fcst: Move ft_recv_write_data()
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4860 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-19 16:50:02 +00:00
Bart Van Assche
a4851afe2d
fcst: Change exch_done() into frame_send() to minimize diffs with upstream
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4859 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-19 16:47:50 +00:00
Bart Van Assche
14a9a7a39d
fcst: Move an fr_seq() call to minimize diffs with upstream
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4858 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-19 16:27:18 +00:00
Bart Van Assche
7d9b329342
fcst: Move a declaration
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4857 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-19 15:23:18 +00:00
Bart Van Assche
029dc3a2e4
fcst: Declare a variable const
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4856 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-05-19 15:15:59 +00:00
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
bd7c893f04
Multiple makefiles: autodetect SCST include directory
...
It is cumbersome to change SCST_INC_DIR and SCST_DIR in each Makefile
before and after a release. Hence modify the Makefiles such that these
paths are detected automatically.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4740 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-01-16 00:12:38 +00:00
Bart Van Assche
bbc27ca421
fcst: Switch to the new and preferred way for printing kernel messages
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4553 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-08 13:27:15 +00:00
Bart Van Assche
81676487b7
fcst: Fix a recently introduced compiler warning
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4520 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-14 07:25:55 +00:00
Vladislav Bolkhovitin
8ce28aaba2
Avoid that enabling a target too quickly triggers a crash
...
The sysfs attributes of a target can be accessed before scst_tgt.tgt_priv
has been set. Avoid that such an access triggers a crash.
Symptom:
BUG: unable to handle kernel NULL pointer dereference at 000000000000004c
IP: [<ffffffffa1345848>] iscsi_is_target_enabled+0x8/0x20 [iscsi_scst]
PGD 150a4c067 PUD 13cacb067 PMD 0
Oops: 0000 [#1 ] SMP
CPU 1
Modules linked in: zfs(P) iscsi_scst(O) scst_vdisk(O) scst(O) zcommon(P) znvpair(P) zavl(P) zunicode(P) spl(O) [last unloaded: zfs]
Pid: 3974, comm: scst_uid1864 Tainted: P O 3.2.23-zfsiscsi-std-ipv6-64 #3 Supermicro X6DVA/X6DVA
RIP: 0010:[<ffffffffa1345848>] [<ffffffffa1345848>] iscsi_is_target_enabled+0x8/0x20 [iscsi_scst]
RSP: 0018:ffff88015071ddc0 EFLAGS: 00010282
RAX: 0000000000000000 RBX: ffff880181fdaa00 RCX: ffff88012d41f380
RDX: ffff88015071c010 RSI: 0000000000000000 RDI: ffff880181fdaa00
RBP: ffff88015071ddc0 R08: 0000000000000000 R09: 0000000000000001
R10: 0000000000000001 R11: 0000000000000001 R12: ffffffffa134a608
R13: 0000000000000000 R14: 0000000000000129 R15: ffffffffa134a4c0
FS: 0000000000000000(0000) GS:ffff88019fc80000(0000)
knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 000000000000004c CR3: 0000000151927000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process scst_uid1864 (pid: 3974, threadinfo ffff88015071c000, task ffff880194d57500)
Stack:
ffff88015071de10 ffffffffa12ee89a 00000000fffffffc 01ff88015071de98
ffff88015071de80 ffff8801932a48d8 00000000fffffffc ffff88015071de98
ffff88015071de80 ffff880194d57500 ffff88015071de30 ffffffffa12f582e
Call Trace:
[<ffffffffa12ee89a>] __scst_is_relative_target_port_id_unique+0x6a/0xc0 [scst]
[<ffffffffa12f582e>] gen_relative_target_port_id+0x6e/0xd0 [scst]
[<ffffffffa12fdb8a>] scst_tgt_enable_store_work_fn+0x3a/0xe0 [scst]
[<ffffffffa12f9397>] sysfs_work_thread_fn+0xc7/0x2e0 [scst]
[<ffffffffa12f92d0>] ? scst_tgtt_release+0x20/0x20 [scst]
[<ffffffffa12f92d0>] ? scst_tgtt_release+0x20/0x20 [scst]
[<ffffffff810b44f6>] kthread+0x96/0xa0
[<ffffffff81b8ed74>] kernel_thread_helper+0x4/0x10
[<ffffffff810b4460>] ? kthread_worker_fn+0x180/0x180
[<ffffffff81b8ed70>] ? gs_change+0xb/0xb
Code: 42 c8 74 0f 39 78 48 75 ea c9 c3 0f 1f 84 00 00 00 00 00 31 c0 c9 c3 66 66 66 2e 0f 1f 84 00 00 00 00 00 48 8b 47 48 55 48 89 e5 <0f> b6 40 4c c9 83 e0 01 c3 66 66 66 66 66 66 2e 0f 1f 84 00 00
RIP [<ffffffffa1345848>] iscsi_is_target_enabled+0x8/0x20 [iscsi_scst]
RSP <ffff88015071ddc0>
CR2: 000000000000004c
---[ end trace 6311d4069703be07 ]---
Reported-by: Etienne Dechamps <e-t172@akegroup.org >
Signed-off-by: Bart Van Assche <bvanassche@acm.org > with some modifications
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4515 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-12 22:13:43 +00:00
Bart Van Assche
26a74cebe8
fcst: Build fix
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4381 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-06-28 06:28:37 +00:00
Bart Van Assche
a4c70b8126
Use rcu_dereference_protected to tell rcu that the ft_lport_lock
...
is held during ft_lport_create. This resolved "suspicious RCU usage"
warnings when debugging options are turned on.
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com >
Tested-by: Ross Brattain <ross.b.brattain@intel.com >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4378 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-06-27 05:11:20 +00:00
Vladislav Bolkhovitin
8f289d5f8e
WRITE SAME implemented
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4262 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-05-01 22:25:37 +00:00
Bart Van Assche
420f85c39b
fcst: Handle exchange timeout gracefully
...
This is a backport of commit e1c4038282c7586c3544542b37872c434669d3ac by
Mark Rustad <mark.d.rustad@intel.com >. This patch avoids that unregistering
a session hangs after an exchange timeout occurred.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4194 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-04-07 07:30:52 +00:00