aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/ubifs/debug.c')
-rw-r--r--fs/ubifs/debug.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index 546ad575b660..06d171cefe45 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -34,7 +34,6 @@
34#include <linux/moduleparam.h> 34#include <linux/moduleparam.h>
35#include <linux/debugfs.h> 35#include <linux/debugfs.h>
36#include <linux/math64.h> 36#include <linux/math64.h>
37#include <linux/slab.h>
38 37
39#ifdef CONFIG_UBIFS_FS_DEBUG 38#ifdef CONFIG_UBIFS_FS_DEBUG
40 39
@@ -2458,14 +2457,12 @@ error_dump:
2458 return 0; 2457 return 0;
2459} 2458}
2460 2459
2461static int invocation_cnt;
2462
2463int dbg_force_in_the_gaps(void) 2460int dbg_force_in_the_gaps(void)
2464{ 2461{
2465 if (!dbg_force_in_the_gaps_enabled) 2462 if (!(ubifs_chk_flags & UBIFS_CHK_GEN))
2466 return 0; 2463 return 0;
2467 /* Force in-the-gaps every 8th commit */ 2464
2468 return !((invocation_cnt++) & 0x7); 2465 return !(random32() & 7);
2469} 2466}
2470 2467
2471/* Failure mode for recovery testing */ 2468/* Failure mode for recovery testing */