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
Kconfig -rw-r--r-- 50.7 KB
Makefile -rw-r--r-- 1.1 KB
calibrate.c -rw-r--r-- 8.3 KB
do_mounts.c -rw-r--r-- 12.8 KB
do_mounts.h -rw-r--r-- 1.4 KB
do_mounts_initrd.c -rw-r--r-- 3.4 KB
do_mounts_md.c -rw-r--r-- 8.2 KB
do_mounts_rd.c -rw-r--r-- 8.4 KB
init_task.c -rw-r--r-- 668 bytes
initramfs.c -rw-r--r-- 12.9 KB
main.c -rw-r--r-- 21.4 KB
noinitramfs.c -rw-r--r-- 1.5 KB
version.c -rw-r--r-- 1.1 KB

back to top