https://github.com/torvalds/linux
Revision f39cdaebb89dc3e6dd4f3e75b6d4e87ef12190af authored by Anton Blanchard on 20 June 2012, 19:53:03 UTC, committed by Linus Torvalds on 20 June 2012, 21:39:36 UTC
After enabling CONFIG_FAILSLAB I noticed random32 in profiles even if slub
fault injection wasn't enabled at runtime.

should_fail forces a comparison against random32() even if probability is
0:

        if (attr->probability <= random32() % 100)
                return false;

Add a check up front for probability == 0 and avoid all of the more
complicated checks.

Signed-off-by: Anton Blanchard <anton@samba.org>
Acked-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 10d8935
History
Tip revision: f39cdaebb89dc3e6dd4f3e75b6d4e87ef12190af authored by Anton Blanchard on 20 June 2012, 19:53:03 UTC
fault-inject: avoid call to random32() if fault injection is disabled
Tip revision: f39cdae
File Mode Size
Makefile -rw-r--r-- 394 bytes
compat.c -rw-r--r-- 18.3 KB
compat_mq.c -rw-r--r-- 4.1 KB
ipc_sysctl.c -rw-r--r-- 6.0 KB
ipcns_notifier.c -rw-r--r-- 2.2 KB
mq_sysctl.c -rw-r--r-- 2.7 KB
mqueue.c -rw-r--r-- 35.6 KB
msg.c -rw-r--r-- 20.9 KB
msgutil.c -rw-r--r-- 2.7 KB
namespace.c -rw-r--r-- 4.3 KB
sem.c -rw-r--r-- 42.1 KB
shm.c -rw-r--r-- 29.6 KB
syscall.c -rw-r--r-- 2.3 KB
util.c -rw-r--r-- 22.8 KB
util.h -rw-r--r-- 5.3 KB

back to top