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
Vladislav Bolkhovitin
e515f17629
scst: Avoid that smatch complains about dead code
...
Reported by Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4488 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 21:58:49 +00:00
Vladislav Bolkhovitin
7efac456a3
qla2x00t: Remove a superfluous cast
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4487 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 21:51:10 +00:00
Vladislav Bolkhovitin
dd37831c06
qla2x00t: Keep smatch happy
...
Smatch reports two warnings on the qla2x00t code:
* sess->local being tested while sess can be NULL.
* The code after the out_unreg_target2x label is only necessary in the procfs build.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4486 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 21:50:15 +00:00
Vladislav Bolkhovitin
0ab789c476
scst_local: Remove a superfluous if-test
...
It is not necessary to test whether a pointer is not NULL before invoking
kfree(). Detected by smatch.
From: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4485 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 21:45:35 +00:00
Vladislav Bolkhovitin
d4e66866b1
scst_vdisk: Remove a superfluous test
...
If the code after the "out_close:" label is reached it is guaranteed that fd != NULL.
Hence remove the if (fd != NULL) test after that label.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4484 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 21:44:30 +00:00
Vladislav Bolkhovitin
a72b347ccf
scst_sysfs: Avoid NULL ptr deref. Fix online documentation
...
Avoid that the PRINT_ERROR() statement that complains about too many parameters
triggers a NULL pointer dereference. Also, fix the online documentation for the
LUN deletion command.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4483 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 21:42:33 +00:00
Vladislav Bolkhovitin
481c90a66b
scst: Add a comment in scst_global_mgmt_thread()
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4482 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 21:10:09 +00:00
Vladislav Bolkhovitin
eb4f05aafe
This patch addresses a minor stylistic issue: use the value
...
returned by mutex_lock_interruptible() instead of explicitly
assigning -EINTR to res.
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4481 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 20:42:58 +00:00
Vladislav Bolkhovitin
6df6692708
scst: Remove a superfluous cast
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4480 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 20:40:05 +00:00
Vladislav Bolkhovitin
fda632ae0b
iscsi-scst: Eliminate a cast
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4479 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 20:38:37 +00:00
Vladislav Bolkhovitin
62b0629e6f
scst: Spelling fix - inquery -> inquiry
...
Signed-off-by: Bart Van Assche <bvanassche@acm.org >
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4478 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 20:36:54 +00:00
Bart Van Assche
113524a39d
nightly build: Update kernel versions
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4477 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 17:27:27 +00:00
Bart Van Assche
160e3aa799
nightly build: Update kernel versions
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4476 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 17:25:53 +00:00
Bart Van Assche
6635cfe307
list-source-files: Process subdirectories correctly
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4475 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 17:24:53 +00:00
Mark Buechler
03f3be2ccb
- Add -no_lip option to prevent automatically issueing a LIP after a configuration change.
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4474 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-27 14:38:54 +00:00
Vladislav Bolkhovitin
10c0bc4f65
Retried commands should go to the local exec stage + small logging improvements
...
It is needed, because local commands can also be retried
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4473 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-24 21:15:38 +00:00
Vladislav Bolkhovitin
7b77e66b07
Workaround (leftover?) events after disable iSNS server
...
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4472 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-24 18:54:35 +00:00