Commit Graph

3415 Commits

Author SHA1 Message Date
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
Vladislav Bolkhovitin
f7fd6bbce0 qla2x00t: Display a clear error message if the kernel is too old
For the people who try to build this driver before reading
qla2x00t/qla2x00-target/README.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4510 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-11 01:26:48 +00:00
Vladislav Bolkhovitin
0c9dda7577 scst: Document CONFIG_SCST_DEBUG_SYSFS_EAGAIN
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4509 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-08 04:43:07 +00:00
Bart Van Assche
1b9567a1cd srpt/README: Recommend to use SLAB instead of SLUB
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4508 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-07 12:36:15 +00:00
Bart Van Assche
ab28f2aaa3 srpt/README: Recommend to disable CONFIG_SCHED_DEBUG and CONFIG_SCHEDSTATS
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4507 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-07 12:20:05 +00:00
Vladislav Bolkhovitin
00e1e72718 scst_user: Change a goto statement into an explicit loop
Signed-off-by: Bart Van Assche <bvanassche@acm.org>




git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4505 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-04 00:05:52 +00:00
Vladislav Bolkhovitin
e46be66d79 scst_main: Convert a goto statement into a loop
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4504 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-04 00:02:17 +00:00
Vladislav Bolkhovitin
2ebba41f55 The comment above scst_act.acg_list_entry was correct until the sysfs
interface was introduced. Update it with information about how acg_list_entry
is used in the sysfs interface.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4503 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-09-03 23:59:05 +00:00
Bart Van Assche
b84cf67525 ib_srpt: Update README
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4502 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-31 14:59:16 +00:00
Vladislav Bolkhovitin
5822ab13ff Revert r4500, it's wrong desicion
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4501 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-30 21:10:55 +00:00
Vladislav Bolkhovitin
38bb4e997e debug_locks not exported on RHEL 6.x, which prevents SCST be used on them, if CONFIG_DEBUG_LOCK_ALLOC set.
Hopefully, debug_locks exported on RHEL 6.4+.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4500 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-30 20:39:08 +00:00
Bart Van Assche
e038e81fb6 scst_sysfs: Add EAGAIN fault injection code.
To do: update scst/Makefile and scst/README with more information about the
CONFIG_SCST_DEBUG_SYSFS_EAGAIN configuration option.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4499 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-30 14:52:55 +00:00
Bart Van Assche
f11ebeafe4 [PATCH] scstadmin: Handle -EAGAIN when reading from sysfs
Reading from /sys/kernel/scst_tgt/devices/*/filename can (at
least in theory) fail with -EAGAIN. Make sure that scstadmin
retries reading from a sysfs variable if that happens. This
patch has been tested by adding the following error injection
code in scst_sysfs.c:

 --------------------------- scst/src/scst_sysfs.c ----------------------------
index 0509703..69efd80 100644
@@ -523,6 +523,22 @@ int scst_sysfs_queue_wait_work(struct scst_sysfs_work_item *work)
 			"failed: %d", atomic_read(&uid_thread_name),
 			(int)PTR_ERR(t));

+#if 1
+	{
+		static int cnt;
+		if (!work->read_only_action || cnt++ % 4 < 3) {
+			/*
+			 * Helps testing user space code that writes to or
+			 * reads from SCST sysfs variables.
+			 */
+			timeout = 0;
+			rc = 0;
+			res = -EAGAIN;
+			goto out_put;
+		}
+	}
+#endif
+
 	while (1) {
 		rc = wait_for_completion_interruptible_timeout(
 			&work->sysfs_work_done, timeout);
 ------------------------------------------------------------------------------

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


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4498 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-30 14:47:49 +00:00
Vladislav Bolkhovitin
396dcf6294 It isn't a error and can happen in normal circumstances
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4497 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-29 20:45:26 +00:00
Vladislav Bolkhovitin
155cde35ae Increase MAX_NR_QUEUED_CMNDS to better handle multu-LUs per target cases
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4496 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-28 19:26:43 +00:00
Vladislav Bolkhovitin
7f16c1b4a2 scst: Fix race triggered by target unregistration
Without this patch it is possible that some target's sysfs attributes
can be called after release() callback returned, when, for instance,
tgt_priv is already set to NULL.



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4495 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-28 01:38:11 +00:00
Vladislav Bolkhovitin
aaac0d983d Fix incorrect errors handling. Detected by smatch.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4494 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-28 01:29:14 +00:00
Vladislav Bolkhovitin
89296abc5e Fix incorrect errors handling. Detected by smatch.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4493 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 22:14:47 +00:00
Vladislav Bolkhovitin
3861a12da5 Fix incorrect errors handling. Detected by smatch.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4492 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 22:12:15 +00:00
Vladislav Bolkhovitin
c1d411eb4f Fix a recently introduced race condition
Make scst_unregister_target() wait again until the session
unregistration callbacks have finished instead of waiting only
until all sessions have been unregistered.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4491 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 22:07:10 +00:00
Vladislav Bolkhovitin
56a29b3ca0 scst_lib: Remove two superfluous tests. Detected by smatch.
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4490 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 22:02:33 +00:00
Vladislav Bolkhovitin
bf00973096 scst_lib: Fix a dereference-before-test. Detected by smatch
Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4489 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 22:00:25 +00:00