Bart Van Assche
45e27bfa42
scstadmin/Makefile: Clean up whitespace usage
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4611 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-09 10:36:59 +00:00
Vladislav Bolkhovitin
dd4907ea62
scst_pres: Introduce kmemdup()
...
The scst_pr_add_registrant() implementation can be made a little more brief by
using kmemdup() instead of kmalloc() + memcpy().
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4610 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-09 02:11:59 +00:00
Bart Van Assche
413a68a53e
scstadmin, Ubuntu: Use update-rc.d instead of the LSB /usr/lib/lsb/remove_initd - the latter is not installed by default
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4609 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-08 14:25:37 +00:00
Bart Van Assche
37431aae60
/etc/init.d/scst: Wait up to 30s before giving up trying to unload a kernel module
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4608 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-08 14:23:13 +00:00
Bart Van Assche
d3dc18dacb
qla2x00t: Fix spelling in a source code comment
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4607 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-08 10:46:34 +00:00
Vladislav Bolkhovitin
54ffcc75c8
Fix incorrect check for TSIH wrap around
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4606 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-07 22:03:07 +00:00
Vladislav Bolkhovitin
16a97e10d1
Silences a compiler warning reported by Richard Sharpe <realrichardsharpe@gmail.com>
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4605 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-07 03:07:38 +00:00
Vladislav Bolkhovitin
e6bff8a950
Cleanup
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4604 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-06 21:31:51 +00:00
Bart Van Assche
edadea8fd0
ib_srpt: RHEL 5.3 build fix
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4603 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-05 08:53:35 +00:00
Bart Van Assche
544d61036c
scst/src/scst_lib.c: RHEL 5.3 build fix
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4602 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-05 08:40:55 +00:00
Bart Van Assche
e834050d35
scst.h, scst_debug.h, scst_pres.h: RHEL 5.3 build fix
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4601 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-05 08:37:20 +00:00
Bart Van Assche
2b428054e6
scst/include/scst_debug.h: RHEL 5 build fix
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4600 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-05 08:14:56 +00:00
Vladislav Bolkhovitin
7ecc784143
Add forgotten list_del() on session creation error path
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4569 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-03 02:08:40 +00:00
Vladislav Bolkhovitin
5cdfbd1817
Make CHAP random number generator stronger
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4568 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-11-03 02:03:15 +00:00
Vladislav Bolkhovitin
4cefa1b830
vdisk_fsync() fixes and cleanups
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4567 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-24 21:22:23 +00:00
Vladislav Bolkhovitin
fab0164c55
scst_local: Avoid deadlock during module removal with kernel 3.6
...
Since kernel 3.6 a SYNCHRONIZE CACHE command is sent to SCSI disks
during the scsi_remove_host() call. That command is sent after command
processing has been suspended in SCST and hence causes a deadlock.
Avoid this deadlock by failing all commands issued after
scst_unregister_target() has been invoked.
The output of echo w >/proc/sysrq-trigger just after module removal of
scst_local started is as follows:
SysRq : Show Blocked State
task PC stack pid father
kworker/2:1 D ffff88003d08cf40 0 37 2 0x00000000
ffff88003d0bd830 0000000000000046 ffffffff814a849e ffff88003d08cf40
ffff88003d08cf40 ffff88003d0bdfd8 ffff88003d0bdfd8 ffff88003d0bdfd8
ffff88003d9a3b70 ffff88003d08cf40 0000000000000282 ffff88003d0bd860
Call Trace:
[<ffffffff814a849e>] ? schedule_timeout+0x12e/0x230
[<ffffffff814aabc9>] schedule+0x29/0x70
[<ffffffff814a84a3>] schedule_timeout+0x133/0x230
[<ffffffff8104cc00>] ? __internal_add_timer+0x140/0x140
[<ffffffff814aaa72>] wait_for_common+0x122/0x170
[<ffffffff81074050>] ? try_to_wake_up+0x2c0/0x2c0
[<ffffffff814aab73>] wait_for_completion_timeout+0x13/0x20
[<ffffffff811edc2b>] blk_execute_rq+0x17b/0x200
[<ffffffff814aa993>] ? wait_for_common+0x43/0x170
[<ffffffff81180a51>] ? bio_phys_segments+0x21/0x30
[<ffffffff811e8cf0>] ? blk_rq_bio_prep+0x30/0xb0
[<ffffffff812e46ee>] scsi_execute+0xee/0x180
[<ffffffff812e58ed>] scsi_execute_req+0xbd/0x130
[<ffffffff812f55c0>] sr_check_events+0xc0/0x2d0
[<ffffffff81076218>] ? sched_clock_cpu+0xa8/0x110
[<ffffffff8131e1cc>] cdrom_check_events+0x1c/0x40
[<ffffffff812f5a39>] sr_block_check_events+0x19/0x20
[<ffffffff811f0e32>] disk_events_workfn+0x62/0x160
[<ffffffff8105affe>] process_one_work+0x1ae/0x620
[<ffffffff8105af9d>] ? process_one_work+0x14d/0x620
[<ffffffff811f0dd0>] ? __disk_unblock_events+0x130/0x130
[<ffffffff8105ce97>] worker_thread+0x187/0x4e0
[<ffffffff8105cd10>] ? manage_workers+0x320/0x320
[<ffffffff81062a07>] kthread+0xb7/0xc0
[<ffffffff81097b35>] ? trace_hardirqs_on_caller+0x105/0x190
[<ffffffff814b5d04>] kernel_thread_helper+0x4/0x10
[<ffffffff814ac870>] ? retint_restore_args+0x13/0x13
[<ffffffff81062950>] ? flush_kthread_work+0x1e0/0x1e0
[<ffffffff814b5d00>] ? gs_change+0x13/0x13
rmmod D ffff88001d46a7a0 0 10456 10437 0x00000004
ffff8800393cd7a8 0000000000000046 ffffffff814a849e ffff88001d46a7a0
ffff88001d46a7a0 ffff8800393cdfd8 ffff8800393cdfd8 ffff8800393cdfd8
ffffffff81a13420 ffff88001d46a7a0 0000000000000282 ffff8800393cd7d8
Call Trace:
[<ffffffff814a849e>] ? schedule_timeout+0x12e/0x230
[<ffffffff814aabc9>] schedule+0x29/0x70
[<ffffffff814a84a3>] schedule_timeout+0x133/0x230
[<ffffffff8104cc00>] ? __internal_add_timer+0x140/0x140
[<ffffffff814aaa72>] wait_for_common+0x122/0x170
[<ffffffff81074050>] ? try_to_wake_up+0x2c0/0x2c0
[<ffffffff814aab73>] wait_for_completion_timeout+0x13/0x20
[<ffffffff811edc2b>] blk_execute_rq+0x17b/0x200
[<ffffffff814aa993>] ? wait_for_common+0x43/0x170
[<ffffffff81063000>] ? __init_waitqueue_head+0x60/0x60
[<ffffffff812e46ee>] scsi_execute+0xee/0x180
[<ffffffff812e58ed>] scsi_execute_req+0xbd/0x130
[<ffffffff812f07a8>] sd_sync_cache+0x98/0x120
[<ffffffff812f0a40>] sd_shutdown+0xd0/0x150
[<ffffffff812f0b3c>] sd_remove+0x7c/0xc0
[<ffffffff812c3e6c>] __device_release_driver+0x7c/0xf0
[<ffffffff812c3f0e>] device_release_driver+0x2e/0x40
[<ffffffff812c380f>] bus_remove_device+0xff/0x170
[<ffffffff812c099d>] device_del+0x12d/0x1c0
[<ffffffff812eae1d>] __scsi_remove_device+0x10d/0x120
[<ffffffff812e97ef>] scsi_forget_host+0x6f/0x80
[<ffffffff812deb8a>] scsi_remove_host+0x7a/0x130
[<ffffffffa0287bea>] scst_local_driver_remove+0x5a/0x120 [scst_local]
[<ffffffff812c3e6c>] __device_release_driver+0x7c/0xf0
[<ffffffff812c3f0e>] device_release_driver+0x2e/0x40
[<ffffffff812c380f>] bus_remove_device+0xff/0x170
[<ffffffff812c099d>] device_del+0x12d/0x1c0
[<ffffffffa028ae21>] ? scst_local_exit+0x6b/0x24a [scst_local]
[<ffffffff812c0a52>] device_unregister+0x22/0x60
[<ffffffffa0287649>] scst_local_remove_adapter+0x59/0xd0 [scst_local]
[<ffffffffa02880ab>] __scst_local_remove_target+0x7b/0x130 [scst_local]
[<ffffffffa028ae3a>] scst_local_exit+0x84/0x24a [scst_local]
[<ffffffff810a2d26>] sys_delete_module+0x1a6/0x2b0
[<ffffffff814ac855>] ? retint_swapgs+0x13/0x1b
[<ffffffff8120ebfe>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[<ffffffff814b4b29>] system_call_fastpath+0x16/0x1b
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4566 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-23 01:08:47 +00:00
Vladislav Bolkhovitin
6b29b72695
- Fix lost residual for allowed to mismatch data transfer direction commands
...
- Fix sending unneeded Control Mode Page MODE SENSE commands. Some devices
may not support this page, so extra calls only fill logs with pointless warnings
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4565 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-23 01:05:31 +00:00
Bart Van Assche
9202352561
nightly build: Update kernel versions
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4564 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-22 06:43:11 +00:00
Bart Van Assche
3e639ad97a
scst/README: Move information from the SCST wiki into the Subversion tree
...
The wiki has been announced to be shut down in 2012Q4 toghether with all
other hosted SourceForge apps, so move the information from there into the
SCST source tree.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4563 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-17 17:53:48 +00:00
Bart Van Assche
b025e3a5ca
nightly build: Update kernel versions
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4562 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-13 14:27:24 +00:00
Vladislav Bolkhovitin
5273bffc10
Web updates
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4561 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-12 21:04:28 +00:00
Vladislav Bolkhovitin
9639ade76e
Web updates
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4560 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-11 00:47:36 +00:00
Bart Van Assche
088ef5c024
nightly build: Update kernel versions
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4559 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-10 19:08:17 +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
0b8bd29208
Single-statement macros should not use do { } while (0)
...
From: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4557 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-10 02:57:07 +00:00
Vladislav Bolkhovitin
73c992f7dd
Convert sizeof expr into sizeof(expr)
...
Avoids that the checkpatch tool included in kernel 3.6 emits the
following warning:
WARNING: sizeof *attr should be sizeof(*attr)
This patch has been generated by running the following command over
the SCST source tree and by reviewing these changes manually:
find -name '*.[ch]' |
xargs -d\\n sed -i.tmp -e 's/sizeof *\([^(][^(),; ]*\)/sizeof(\1)/g'
From: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4556 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-10 02:55:31 +00:00
Vladislav Bolkhovitin
b50f3aa7cf
scst, procfs: Fix a potential out-of-range array access
...
This patch fixes the following smatch warning:
drivers/scst/scst_proc.c: scst_dev_handler_type_info_show() error: buffer overflow 'scst_proc_dev_handler_type' 16 <= 16
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4555 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-10 02:48:15 +00:00
Bart Van Assche
9e1b02afa8
ib_srpt: Remove an unused variable
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4554 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-08 14:09:27 +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
dd11e8130a
ibmvstgt: Switch to the new and preferred way for printing kernel messages
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4552 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-08 13:26:57 +00:00
Bart Van Assche
a068395618
nightly build: Improve sparse output filtering
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4551 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-08 13:21:41 +00:00
Vladislav Bolkhovitin
92d5e3dcb1
Make BLOCKIO flush async.
...
Tested only on kernels >=2.6.37.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4550 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-05 20:30:22 +00:00
Bart Van Assche
ed80b73fc2
nightly build: Add a missing backslash
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4549 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-05 06:39:47 +00:00
Vladislav Bolkhovitin
04d093a366
Cleanup
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4548 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-04 22:18:01 +00:00
Vladislav Bolkhovitin
8828cfe315
Set MAXIMUM WRITE SAME LENGTH
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4547 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-04 22:08:02 +00:00
Vladislav Bolkhovitin
05bff10f05
During nexus loss reservations should not be cleared + add possibility for device specific states be retained during nexus loss as well.
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4546 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-04 20:32:59 +00:00
Vladislav Bolkhovitin
57d7bcd809
Fix 2 bugs in iscsi_attr_replace() sent by Lev Vainblat <lev@zadarastorage.com>:
...
1. After attr was found in the attrs_list, it is inserted again back into the same list. As a result the list becomes corrupted.
The bug can be reproduced for example by the following sequence:
$ echo add_attribute IncomingUser user secret111111 > /sys/kernel/scst_tgt/targets/iscsi/mgmt
$ echo user secret222222 > /sys/kernel/scst_tgt/targets/iscsi/IncomingUser
$ echo del_attribute IncomingUser user > /sys/kernel/scst_tgt/targets/iscsi/mgmt
$ iscsiadm -m discovery -t st -p 127.0.0.1
Discovery fails and in syslog there is a message
Oct 2 18:58:37 vsa-00000611 iscsi-scstd: [1059] cmnd_exec_login:940: ERROR: Authentication of initiator iqn.2011-04.com.zadarastorage:1553:vc-0 failed
2. Small memory leak in error recovery path.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4545 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-04 18:34:25 +00:00
Bart Van Assche
3e36bb0357
nightly build: Add kernel 3.6
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4544 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-03 17:59:25 +00:00
Vladislav Bolkhovitin
bcc9ad6381
Cleanup
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4543 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-02 18:57:35 +00:00
Vladislav Bolkhovitin
5f94cac0df
Logging improvements
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4542 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-02 18:47:29 +00:00
Bart Van Assche
e1159c7395
ibmvstgt: Convert 'sizeof e' into 'sizeof(e)'
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4541 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-02 08:30:15 +00:00
Bart Van Assche
8801f5babf
ib_srpt: Convert 'sizeof e' into 'sizeof(e)'
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4540 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-02 08:29:45 +00:00
Bart Van Assche
b2567396f8
nightly build: Add kernel 3.6 support patches
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4539 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-02 08:17:58 +00:00
Vladislav Bolkhovitin
1a8577c59c
Update for 3.6 kernels
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4538 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-01 22:10:47 +00:00
Bart Van Assche
62ba210a31
scstadmin: Create /etc/default if it does not yet exist
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4537 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-01 13:25:28 +00:00
Bart Van Assche
f79293427a
scstadmin: Use $(DESTDIR) when uninstalling SCST 2.x startup scripts
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4536 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-10-01 13:24:46 +00:00
Vladislav Bolkhovitin
96f498e9c8
Add support patch for rebuilding RHEL 6.3 kernel RPM
...
Add put_page_callback-2.6.32-279.patch (a copy of the RHEL 6.2 version
of the same patch) such that scripts/rebuild-rhel-kernel-rpm can rebuild
the RHEL 6.3 kernel RPM.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4535 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-29 22:34:58 +00:00
Vladislav Bolkhovitin
d2d0c488aa
scst_local_add_target(): Also set *out_tgt upon failure
...
Although the callers of scst_local_add_target() do not use the
value of *out_tgt if scst_local_add_target() reports that it failed,
set *out_tgt in that case to avoid that sparse reports the following
(false positive) warning:
scst_local/scst_local.c:1807: warning: 'tgt' may be used uninitialized in this function
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4534 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-29 22:33:20 +00:00
Vladislav Bolkhovitin
9e9b1f8ac4
Oops, the previous commit was incomplete
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4533 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-28 21:09:49 +00:00
Vladislav Bolkhovitin
560383df22
Let's return error on not block size aligned writes
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4532 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-28 21:04:56 +00:00