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
388cb01060
Fix NopInInterval README info to show that a NOP-In will timeout
...
when NopInTimeout seconds and not the RspTimeout seconds has passed
without getting a response.
Signed-off-by: Mike Christie <michaelc@cs.wisc.edu >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5094 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-09 03:21:19 +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
Bart Van Assche
e0b01fde9c
scst_tg: Use tabs instead of spaces for indentation
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5090 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-07 19:21:05 +00:00
Bart Van Assche
2ac3f6ef3b
scst_tg: Reduce number of checkpatch warnings about long source code lines
...
This patch does not change any functionality.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5089 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-07 19:16:07 +00:00
Bart Van Assche
bce0b45855
scst_tg: Simplify scst_impl_alua_configured()
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5088 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-07 00:02:26 +00:00
Bart Van Assche
7eafb15fcb
scst_sysfs: Follow-up for r5086
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5087 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-11-01 16:05:57 +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
7fb71c06b4
Cleanup duplication with RECEIVE WORM command
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5085 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-31 04:40:47 +00:00
Vladislav Bolkhovitin
a8546ee31c
scst_lib: Fix parsing the FIXED bit for tape devices
...
This patch restores support for the FIXED bit in tape commands. This
patch is necessary since some time ago SCST_TRANSFER_LEN_TYPE_FIXED has
been changed from 1 into 4. From the SVN change log:
r4896 | vlnb | 2013-06-06 21:43:51 -0700 (Thu, 06 Jun 2013) | 9 lines
scst_lib: Rework the CDB parsing routines
Factor out common code into a new function.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5084 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-31 04:35:15 +00:00
Vladislav Bolkhovitin
6c9ea47b23
Disable automatic sessions unregistration
...
Nowadays scst_local doesn't need anymore auto closing sessions on target
unregistration. Moreover, it can lead for it to the following Oops:
BUG at /home/bart/software/scst.git/scst/src/scst_targ.c:6293
------------[ cut here ]------------
kernel BUG at /home/bart/software/scst.git/scst/src/scst_targ.c:6293!
RIP: 0010:[<ffffffffa07c5110>] [<ffffffffa07c5110>] scst_post_rx_mgmt_cmd+0x2b0/0x340 [scst]
Call Trace:
[<ffffffffa07c5289>] scst_rx_mgmt_fn+0xe9/0x3a0 [scst]
[<ffffffffa07cd75a>] scst_rx_mgmt_fn_lun.constprop.34+0x4a/0x60 [scst]
[<ffffffffa07cd804>] scst_unregister_session+0x94/0x250 [scst]
[<ffffffffa03c2ae8>] scst_local_release_adapter+0xa8/0x160 [scst_local]
[<ffffffff812ad42d>] device_release+0x3d/0xb0
[<ffffffff811f0db2>] kobject_cleanup+0x82/0x1b0
[<ffffffff811f0f1b>] kobject_put+0x2b/0x60
[<ffffffff812ad177>] put_device+0x17/0x20
[<ffffffffa00027e3>] scsi_host_dev_release+0xb3/0xe0 [scsi_mod]
[<ffffffff812ad42d>] device_release+0x3d/0xb0
[<ffffffff811f0db2>] kobject_cleanup+0x82/0x1b0
[<ffffffff811f0f1b>] kobject_put+0x2b/0x60
[<ffffffff812ad177>] put_device+0x17/0x20
[<ffffffffa000b2f2>] scsi_target_dev_release+0x22/0x30 [scsi_mod]
[<ffffffff812ad42d>] device_release+0x3d/0xb0
[<ffffffff811f0db2>] kobject_cleanup+0x82/0x1b0
[<ffffffff811f0f1b>] kobject_put+0x2b/0x60
[<ffffffff812ad177>] put_device+0x17/0x20
[<ffffffffa000ebd5>] scsi_device_dev_release_usercontext+0x1a5/0x1c0 [scsi_mod]
[<ffffffff8105d835>] execute_in_process_context+0x65/0x70
[<ffffffffa000e66c>] scsi_device_dev_release+0x1c/0x20 [scsi_mod]
[<ffffffff812ad42d>] device_release+0x3d/0xb0
[<ffffffff811f0db2>] kobject_cleanup+0x82/0x1b0
[<ffffffff811f0f1b>] kobject_put+0x2b/0x60
[<ffffffff812ad177>] put_device+0x17/0x20
[<ffffffffa0000ca4>] scsi_device_put+0x44/0x60 [scsi_mod]
[<ffffffffa00e58f9>] scsi_disk_put+0x39/0x50 [sd_mod]
[<ffffffffa00e62fb>] sd_release+0x4b/0xd0 [sd_mod]
[<ffffffff81175b2c>] __blkdev_put+0x16c/0x1c0
[<ffffffff813f4cf7>] ? _raw_spin_lock_irq+0x17/0x40
[<ffffffff81175bd7>] blkdev_put+0x57/0x130
[<ffffffff81175cd5>] blkdev_close+0x25/0x30
[<ffffffff8114042b>] __fput+0xdb/0x230
[<ffffffff811405ce>] ____fput+0xe/0x10
[<ffffffff810617d7>] task_work_run+0xa7/0xe0
[<ffffffff810028e9>] do_notify_resume+0x79/0xa0
[<ffffffff813fd930>] int_signal+0x12/0x17
So, experimantally disable this functionality.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5083 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-31 03:53:14 +00:00
Vladislav Bolkhovitin
1e4010ce25
Cleanup
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5082 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-31 03:48:59 +00:00
Bart Van Assche
4e6228fbb0
scstadmin: Avoid confusing Emacs' syntax highlighting algorithm
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5081 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-24 07:26:35 +00:00
Bart Van Assche
95a503e5c6
doc/scst_user_spec.sgml: Spelling fix - change descrition into description
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5080 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-23 07:38:40 +00:00
Bart Van Assche
3e75fc65cf
scst documentation spelling fix: lenght -> length
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5079 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-23 07:37:39 +00:00
Vladislav Bolkhovitin
79d74f0446
Microoptimization
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5078 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-23 04:35:57 +00:00
Vladislav Bolkhovitin
8a09d515b0
Cleanup
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5077 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-23 04:25:27 +00:00
Vladislav Bolkhovitin
11f3535132
scst: Fail unsupported commands properly
...
Report UNSUPPORTED OPCODE instead of ILLEGAL_REQUEST / LBA_OUT_OF_RANGE
for unsupported opcodes. For unsupported commands the SCST_LBA_NOT_VALID
flag is not set and cmd->lba == 0xffffffffffffffffU. That causes the test
in scst_generic_parse() for out-of-range LBA's to trigger. Avoid that by
explicitly setting the SCST_LBA_NOT_VALID flag for unsupported opcodes.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5076 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-22 05:24:38 +00:00
Bart Van Assche
5d8a563648
scstadmin: Reduce the time needed to save or restore a configuration
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5075 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-21 18:36:01 +00:00
Bart Van Assche
391eaa811a
nightly build: Update kernel versions
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5074 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-21 18:30:45 +00:00
Bart Van Assche
7faa68e8ce
ib_srpt/README: Simplify the instructions for logging in to an SRP target
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5073 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-18 08:36:47 +00:00
Bart Van Assche
db2c0442d3
scst: Rework r5023
...
Avoid that session reassignment can trigger a crash with iscsi-scst or
scst_local by not generating a UA from inside scst_tg_init_tgt_dev().
Not generating an ALUA UA upon LUN addition is fine since such LUN
addition will trigger a REPORTED LUNS DATA HAS CHANGED UA anyway.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5072 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-14 15:21:30 +00:00
Vladislav Bolkhovitin
c65a4462dc
Improving thin provisioning support according to recent SBC updates
...
As the result, Windows 2012 started considered SCST devices thin provisioned
Reported and tested by Sergey Tashkinov <sergeyt1@open-e.com >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5071 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-12 06:01:14 +00:00
Bart Van Assche
ca750d6383
scstadmin: Add more regression tests
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5070 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 16:40:02 +00:00
Bart Van Assche
a02cf2379d
scstadmin, SCST.pm, targets(): Return target names sorted alphabetically
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5069 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 16:33:05 +00:00
Bart Van Assche
dad81d3ba5
scstadmin: Add a regression test infrastructure
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5068 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:37:16 +00:00
Bart Van Assche
0298c2ecc3
scstadmin, SCST.pm: Fix checkTargetDynamicAttributes() return code
...
If no attributes have been passed to this function via the second argument,
only report success if the driver (first argument) exists.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5067 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:36:40 +00:00
Bart Van Assche
5ea0cf813f
scstadmin, SCST.pm: Make argument checking more strict
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5066 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:30:31 +00:00
Bart Van Assche
00a6eeafe7
scstadmin: Add command-line option -cont_on_err
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5065 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:28:05 +00:00
Bart Van Assche
4b63daed53
scstadmin, SCST.pm: Fix checkDriverDynamicAttributes() return code
...
If no attributes have been passed to this function via the second argument,
only report success if the driver (first argument) exists.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5064 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:14:11 +00:00
Bart Van Assche
9e77adb8b8
scstadmin, SCST.pm: Fix setLunAttribute() error return code
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5063 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:10:58 +00:00
Bart Van Assche
bf82499635
scstadmin, SCST.pm: Fix lunExists() return code
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5062 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:09:59 +00:00
Bart Van Assche
960759632f
scstadmin, SCST.pm: Avoid triggering runtime warnings about strings having the value "undef"
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5061 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:08:38 +00:00
Bart Van Assche
70a9baa58a
scstadmin, SCST.pm: Check the number of arguments passed to subroutines
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5060 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:07:47 +00:00
Bart Van Assche
5fc9261fc8
scstadmin, SCST.pm: Remove dead code
...
_syswrite() either returns a positive number or undef but never -1.
Hence remove code that would only be executed if _syswrite() would
have returned -1.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5059 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:04:59 +00:00
Bart Van Assche
2a93823408
scstadmin: Fix Perl syntax
...
The Perl operator for comparing strings is "eq" and not "=".
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5058 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:04:16 +00:00
Bart Van Assche
117304c1a7
scstadmin: Fix a typo in a diagnostic message
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5057 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:03:05 +00:00
Bart Van Assche
140c5af41c
scstadmin: Set hardware target attributes correctly
...
For target drivers that support creating targets, e.g. the Emulex
FC driver, it is possible that a target attribute is both writable
for existing (hardware) targets and that it has to be specified
when creating a (virtual) target. Make sure that scstadmin sets
these attributes for existing (hardware) targets when restoring a
configuration.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5056 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 15:02:25 +00:00
Bart Van Assche
813a97afc3
scstadmin: Add infrastructure for building an RPM
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5055 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 14:32:40 +00:00
Bart Van Assche
cdf784a6ad
ib_srpt: Simplify the code for waking up the srpt thread after login
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5054 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 12:53:59 +00:00
Vladislav Bolkhovitin
404b21b5f0
iscsi-scst, scst_local: Avoid that session reassignment triggers a crash
...
This patch fixes the following crash triggered by session reassignment when using a
target driver that defines a report_aen callback in its target template (iscsi-scst
and scst_local):
BUG: unable to handle kernel NULL pointer dereference at 00000000000000c0
IP: [<ffffffffa0299e1f>] scst_alloc_aen+0xbf/0x220 [scst]
RIP: 0010:[<ffffffffa0299e1f>] [<ffffffffa0299e1f>] scst_alloc_aen+0xbf/0x220 [scst]
Call Trace:
[<ffffffffa02a0aef>] scst_gen_aen_or_ua+0xff/0x2d0 [scst]
[<ffffffffa02c3661>] scst_tg_change_tgt_dev_state+0x61/0xd0 [scst]
[<ffffffffa02c428b>] scst_tg_init_tgt_dev+0x5b/0xa0 [scst]
[<ffffffffa029c246>] scst_alloc_add_tgt_dev+0x686/0x750 [scst]
[<ffffffffa02a2b57>] scst_check_reassign_sess+0x367/0x660 [scst]
[<ffffffffa02a2ed8>] scst_check_reassign_sessions+0x88/0x140 [scst]
[<ffffffffa02a323a>] scst_acg_add_acn+0x1ba/0x2b0 [scst]
[<ffffffffa02a9fcf>] scst_process_acg_ini_mgmt_store+0x43f/0x570 [scst]
[<ffffffffa02aa11e>] scst_acg_ini_mgmt_store_work_fn+0x1e/0x20 [scst]
[<ffffffffa02b051f>] scst_process_sysfs_works+0xbf/0x190 [scst]
[<ffffffffa02b07a0>] sysfs_work_thread_fn+0x110/0x2a0 [scst]
[<ffffffff81069ea6>] kthread+0xd6/0xe0
[<ffffffff814debfc>] ret_from_fork+0x7c/0xb0
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5053 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 04:02:46 +00:00
Vladislav Bolkhovitin
c66294d36f
Avoid that unloading SCST hangs when using bcache
...
Although it seems to be bcache problem, remove the
flush_scheduled_work() call because it is not necessary. Call
cancel_delayed_work_sync() after unregistration from sysfs just in case
a sysfs attribute would ever be added that allows to trigger pool
purging directly.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5052 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-10 03:17:57 +00:00
Bart Van Assche
5930dac028
nightly build: Update kernel versions
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5049 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-06 09:01:13 +00:00
Vladislav Bolkhovitin
2e6c29d904
Add FORMAT MEDIUM tape command to scst_scsi_op_table
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5022 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-04 23:58:16 +00:00
Vladislav Bolkhovitin
7fd3d9da4e
Relax this FW overload message
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5021 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-04 04:52:26 +00:00
Vladislav Bolkhovitin
7502f47dad
Fix small possible race in sessions management
...
In q2t_del_sess_work_fn() session can get ready to be destroyed before
hardware_lock is taken
From Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5020 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-04 02:17:43 +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
1342a944db
Fix recently discovered races in sessions management
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@5018 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2013-10-03 04:24:39 +00:00