diff options
Diffstat (limited to 'fs/ubifs/tnc_commit.c')
-rw-r--r-- | fs/ubifs/tnc_commit.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/ubifs/tnc_commit.c b/fs/ubifs/tnc_commit.c index d6fab1a9986c..8959c726b024 100644 --- a/fs/ubifs/tnc_commit.c +++ b/fs/ubifs/tnc_commit.c | |||
@@ -23,6 +23,7 @@ | |||
23 | /* This file implements TNC functions for committing */ | 23 | /* This file implements TNC functions for committing */ |
24 | 24 | ||
25 | #include "ubifs.h" | 25 | #include "ubifs.h" |
26 | #include <linux/random.h> | ||
26 | 27 | ||
27 | /** | 28 | /** |
28 | * make_idx_node - make an index node for fill-the-gaps method of TNC commit. | 29 | * make_idx_node - make an index node for fill-the-gaps method of TNC commit. |
@@ -381,7 +382,7 @@ static int layout_in_gaps(struct ubifs_info *c, int cnt) | |||
381 | c->gap_lebs = NULL; | 382 | c->gap_lebs = NULL; |
382 | return err; | 383 | return err; |
383 | } | 384 | } |
384 | if (dbg_force_in_the_gaps_enabled()) { | 385 | if (!dbg_is_chk_gen(c)) { |
385 | /* | 386 | /* |
386 | * Do not print scary warnings if the debugging | 387 | * Do not print scary warnings if the debugging |
387 | * option which forces in-the-gaps is enabled. | 388 | * option which forces in-the-gaps is enabled. |
@@ -689,7 +690,7 @@ static int alloc_idx_lebs(struct ubifs_info *c, int cnt) | |||
689 | c->ilebs[c->ileb_cnt++] = lnum; | 690 | c->ilebs[c->ileb_cnt++] = lnum; |
690 | dbg_cmt("LEB %d", lnum); | 691 | dbg_cmt("LEB %d", lnum); |
691 | } | 692 | } |
692 | if (dbg_force_in_the_gaps()) | 693 | if (dbg_is_chk_gen(c) && !(random32() & 7)) |
693 | return -ENOSPC; | 694 | return -ENOSPC; |
694 | return 0; | 695 | return 0; |
695 | } | 696 | } |