diff options
Diffstat (limited to 'lib/fault-inject.c')
-rw-r--r-- | lib/fault-inject.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/fault-inject.c b/lib/fault-inject.c index 6805453c18e7..f7210ad6cffd 100644 --- a/lib/fault-inject.c +++ b/lib/fault-inject.c | |||
@@ -101,6 +101,10 @@ static inline bool fail_stacktrace(struct fault_attr *attr) | |||
101 | 101 | ||
102 | bool should_fail(struct fault_attr *attr, ssize_t size) | 102 | bool should_fail(struct fault_attr *attr, ssize_t size) |
103 | { | 103 | { |
104 | /* No need to check any other properties if the probability is 0 */ | ||
105 | if (attr->probability == 0) | ||
106 | return false; | ||
107 | |||
104 | if (attr->task_filter && !fail_task(attr, current)) | 108 | if (attr->task_filter && !fail_task(attr, current)) |
105 | return false; | 109 | return false; |
106 | 110 | ||