|
@@ -110,10 +110,12 @@ bool should_fail(struct fault_attr *attr, ssize_t size)
|
|
if (in_task()) {
|
|
if (in_task()) {
|
|
unsigned int fail_nth = READ_ONCE(current->fail_nth);
|
|
unsigned int fail_nth = READ_ONCE(current->fail_nth);
|
|
|
|
|
|
- if (fail_nth && !WRITE_ONCE(current->fail_nth, fail_nth - 1))
|
|
|
|
- goto fail;
|
|
|
|
|
|
+ if (fail_nth) {
|
|
|
|
+ if (!WRITE_ONCE(current->fail_nth, fail_nth - 1))
|
|
|
|
+ goto fail;
|
|
|
|
|
|
- return false;
|
|
|
|
|
|
+ return false;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
/* No need to check any other properties if the probability is 0 */
|
|
/* No need to check any other properties if the probability is 0 */
|