aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-10-11 01:49:56 -0400
committerNeilBrown <neilb@suse.de>2011-10-11 01:49:56 -0400
commit29d3247ea2274bca0d0b7f41fcf3b82e0a8bc44c (patch)
tree703fae8142e179a6007390a43ff48e18321f848c /drivers/md
parentd1688a6d5515f1900af76a963b4bb6d9a6554cfa (diff)
md/bitmap remove fault injection options.
These are too hard to use to be much more than noise. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/bitmap.c34
1 files changed, 1 insertions, 33 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 2d5158c8d6be..7878712721bf 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -29,27 +29,6 @@
29#include "md.h" 29#include "md.h"
30#include "bitmap.h" 30#include "bitmap.h"
31 31
32/* debug macros */
33
34#define DEBUG 0
35
36#if DEBUG
37/* these are for debugging purposes only! */
38
39/* define one and only one of these */
40#define INJECT_FAULTS_1 0 /* cause bitmap_alloc_page to fail always */
41#define INJECT_FAULTS_2 0 /* cause bitmap file to be kicked when first bit set*/
42#define INJECT_FAULTS_3 0 /* treat bitmap file as kicked at init time */
43#define INJECT_FAULTS_4 0 /* undef */
44#define INJECT_FAULTS_5 0 /* undef */
45#define INJECT_FAULTS_6 0
46
47/* if these are defined, the driver will fail! debug only */
48#define INJECT_FATAL_FAULT_1 0 /* fail kmalloc, causing bitmap_create to fail */
49#define INJECT_FATAL_FAULT_2 0 /* undef */
50#define INJECT_FATAL_FAULT_3 0 /* undef */
51#endif
52
53static inline char *bmname(struct bitmap *bitmap) 32static inline char *bmname(struct bitmap *bitmap)
54{ 33{
55 return bitmap->mddev ? mdname(bitmap->mddev) : "mdX"; 34 return bitmap->mddev ? mdname(bitmap->mddev) : "mdX";
@@ -62,11 +41,7 @@ static unsigned char *bitmap_alloc_page(struct bitmap *bitmap)
62{ 41{
63 unsigned char *page; 42 unsigned char *page;
64 43
65#ifdef INJECT_FAULTS_1
66 page = NULL;
67#else
68 page = kzalloc(PAGE_SIZE, GFP_NOIO); 44 page = kzalloc(PAGE_SIZE, GFP_NOIO);
69#endif
70 if (!page) 45 if (!page)
71 printk("%s: bitmap_alloc_page FAILED\n", bmname(bitmap)); 46 printk("%s: bitmap_alloc_page FAILED\n", bmname(bitmap));
72 else 47 else
@@ -990,11 +965,7 @@ static int bitmap_init_from_disk(struct bitmap *bitmap, sector_t start)
990 965
991 BUG_ON(!file && !bitmap->mddev->bitmap_info.offset); 966 BUG_ON(!file && !bitmap->mddev->bitmap_info.offset);
992 967
993#ifdef INJECT_FAULTS_3
994 outofdate = 1;
995#else
996 outofdate = bitmap->flags & BITMAP_STALE; 968 outofdate = bitmap->flags & BITMAP_STALE;
997#endif
998 if (outofdate) 969 if (outofdate)
999 printk(KERN_INFO "%s: bitmap file is out of date, doing full " 970 printk(KERN_INFO "%s: bitmap file is out of date, doing full "
1000 "recovery\n", bmname(bitmap)); 971 "recovery\n", bmname(bitmap));
@@ -1800,11 +1771,8 @@ int bitmap_create(struct mddev *mddev)
1800 bitmap->pages = pages; 1771 bitmap->pages = pages;
1801 bitmap->missing_pages = pages; 1772 bitmap->missing_pages = pages;
1802 1773
1803#ifdef INJECT_FATAL_FAULT_1
1804 bitmap->bp = NULL;
1805#else
1806 bitmap->bp = kzalloc(pages * sizeof(*bitmap->bp), GFP_KERNEL); 1774 bitmap->bp = kzalloc(pages * sizeof(*bitmap->bp), GFP_KERNEL);
1807#endif 1775
1808 err = -ENOMEM; 1776 err = -ENOMEM;
1809 if (!bitmap->bp) 1777 if (!bitmap->bp)
1810 goto error; 1778 goto error;