mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 03:01:26 +00:00
f11ebeafe43ea4a7d63642fcd28ee34d13a62ed5
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
This is the SCST development repository. It contains not a single project SCST as one can think, but a number of them, which are divided as the following: 1. SCST core in scst/ subdirectory 2. Administration utility for SCST core scstadmin in scstadmin/ 3. Target drivers in own subdirectories qla2x00t/, iscsi-scst/, etc. 4. User space programs in usr/ subdirectory, like fileio_tgt. 5. Some various docs in doc/ subdirectory. Those subprojects are in most cases independent from each other, although some of them depend from the SCST core. They put in the single repository only to simplify their development, they are released independently. Thus, use "make all" only if you really need to build everything. Otherwise build only what you need, like for iSCSI-SCST: make scst scst_install iscsi iscsi_install For more information about each subproject see their README files. Vladislav Bolkhovitin <vst@vlnb.net>, http://scst.sourceforge.net
Description
Languages
C
90.1%
Perl
4.2%
Shell
1.8%
HTML
1.7%
Makefile
1.2%
Other
0.9%