Commit Graph

3389 Commits

Author SHA1 Message Date
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
Vladislav Bolkhovitin
19153e3a65 Ensure that generated USN is unique
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4471 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-24 02:15:04 +00:00
Vladislav Bolkhovitin
5b26b06791 We need to abort internal commands as well.
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4470 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-16 19:52:32 +00:00
Vladislav Bolkhovitin
5305d716ea Web updates
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4469 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-16 01:36:10 +00:00
Vladislav Bolkhovitin
628cbf0ddd Fix crash on attach an initiator to an empty vcdrom device,
then add a "disk" to it via sysfs and then try to read from it from the initiator.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4468 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-14 19:15:57 +00:00
Vladislav Bolkhovitin
b08cee14bd Cleanup and minor sysfs entry creation fix
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4467 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-13 22:01:25 +00:00
Bart Van Assche
f090f59a48 nightly build: Reduce noice in smatch output diffs
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4466 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-12 08:44:59 +00:00
Vladislav Bolkhovitin
f0df328198 Microoptimization
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4465 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-11 01:37:07 +00:00
Vladislav Bolkhovitin
0327e15440 Currently there is a possibility that a session name is reused and
passed to scst_sess_sysfs_create() before scst_sess_sysfs_del() has
finished removing a kobject that is using the same session name. This
patch fixes that. It works by maintaining yet another session list,
namely a list of sessions registered in sysfs, and by using that list to
check for duplicate session names.

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



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4464 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-10 02:02:35 +00:00
Vladislav Bolkhovitin
1b68210cce Fix possible commands hangs with lockless queuecommand() in scst_local
git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4463 d57e44dd-8a1f-0410-8b47-8ef2f437770f
2012-08-10 01:48:35 +00:00