mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-25 07:51:28 +00:00
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
This commit is contained in:
@@ -523,6 +523,23 @@ int scst_sysfs_queue_wait_work(struct scst_sysfs_work_item *work)
|
||||
"failed: %d", atomic_read(&uid_thread_name),
|
||||
(int)PTR_ERR(t));
|
||||
|
||||
#ifdef CONFIG_SCST_DEBUG_SYSFS_EAGAIN
|
||||
{
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user