aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/fault-inject.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/fault-inject.c b/lib/fault-inject.c
index 5da665ac2d89..d143c0faf248 100644
--- a/lib/fault-inject.c
+++ b/lib/fault-inject.c
@@ -142,9 +142,6 @@ bool should_fail(struct fault_attr *attr, ssize_t size)
142 if (attr->task_filter && !fail_task(attr, current)) 142 if (attr->task_filter && !fail_task(attr, current))
143 return false; 143 return false;
144 144
145 if (!fail_stacktrace(attr))
146 return false;
147
148 if (atomic_read(&attr->times) == 0) 145 if (atomic_read(&attr->times) == 0)
149 return false; 146 return false;
150 147
@@ -159,12 +156,12 @@ bool should_fail(struct fault_attr *attr, ssize_t size)
159 return false; 156 return false;
160 } 157 }
161 158
162 if (attr->probability > random32() % 100) 159 if (attr->probability <= random32() % 100)
163 goto fail; 160 return false;
164 161
165 return false; 162 if (!fail_stacktrace(attr))
163 return false;
166 164
167fail:
168 fail_dump(attr); 165 fail_dump(attr);
169 166
170 if (atomic_read(&attr->times) != -1) 167 if (atomic_read(&attr->times) != -1)