Commit Graph

3436 Commits

Author SHA1 Message Date
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
Bart Van Assche
7110f25138 nightly/bin/nightly: Generalize
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4531 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-28 13:25:04 +00:00
Vladislav Bolkhovitin
791e5244f9 Cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4530 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-28 00:39:17 +00:00
Vladislav Bolkhovitin
44ca9139d7 All CTIO_TYPE7 status mode 1 data are little endian
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4529 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-27 22:34:21 +00:00
Vladislav Bolkhovitin
1291645acf scst_vdisk/procfs: Fix a copy/paste error
Make sure that the variable "c" is incremented with the number of characters
added.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4528 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-26 20:26:17 +00:00
Vladislav Bolkhovitin
066ecf9a2d SCST README: Document LUN addressing method
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4527 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-26 20:24:30 +00:00
Vladislav Bolkhovitin
80a7456754 Web updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4526 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-26 20:23:55 +00:00
Bart Van Assche
d424897fed scripts/rebuild-rhel-kernel-rpm: Exclude the RHEL qla2xxx initiator from the rebuilt kernel RPM since it conflicts with the SCST qla2xxx initiator
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4525 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-26 13:01:59 +00:00
Bart Van Assche
de6308dc2f scripts/rebuild-rhel-kernel-rpm: Correct CentOS download URLs
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4524 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-26 13:00:56 +00:00
Bart Van Assche
b05c6dafa0 scripts/run-regression-tests: Disable CONFIG_HEADERS_CHECK
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4523 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-26 07:24:52 +00:00
Vladislav Bolkhovitin
0605b35c02 scst_vdisk: Fix blockio_exec_rw() error path
Send back a BUSY response if not enough memory is available to process a read or write request.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4522 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-24 20:03:08 +00:00
Bart Van Assche
ada257d793 scripts/test-persistent-reservation: Enable APTPL
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4521 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-19 17:01:17 +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
7b1f00d2cb Increase version to -pre2. Pre1 was staying for too long.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4519 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-14 01:33:58 +00:00
Vladislav Bolkhovitin
dd0fc4b56d Docs and web updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4518 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-14 01:31:05 +00:00
Vladislav Bolkhovitin
7f4db4c14b cmd's bufflen and data_len overflow cleanups
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4517 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-13 20:35:00 +00:00
Bart Van Assche
3d1468cfac ib_srpt: Convert two functions two single-exit style
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4516 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-13 08:15:23 +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
14e29d815e ib_srpt README: Add more performance notes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4514 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-12 14:06:47 +00:00
Vladislav Bolkhovitin
e9008a5b12 Fix possible BUG_ON() on multiple forced commands release
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4513 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-11 20:38:57 +00:00
Vladislav Bolkhovitin
a2825d8b06 Fix scst_local crash on 0 response data len w/o data buffer allocated
+ some related cleanups

Reported by Richard Sharpe <realrichardsharpe@gmail.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4512 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-11 18:42:42 +00:00
Bart Van Assche
d8b5dd28b4 ib_srpt README: Add more performance notes
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4511 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-11 15:58:29 +00:00