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
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
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
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
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
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
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
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
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