[Ocfs2-tools-devel] [PATCH 3/8] Mess up superblock ECC

Goldwyn Rodrigues rgoldwyn at gmail.com
Mon Aug 1 10:58:26 PDT 2011


Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.de>
---
 fswreck/Makefile            |    2 +-
 fswreck/corrupt.c           |    7 +++++++
 fswreck/include/corrupt.h   |    2 ++
 fswreck/include/fsck_type.h |    1 +
 fswreck/include/main.h      |    1 +
 fswreck/main.c              |    2 ++
 6 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/fswreck/Makefile b/fswreck/Makefile
index b1ee546..b870af7 100644
--- a/fswreck/Makefile
+++ b/fswreck/Makefile
@@ -10,7 +10,7 @@ INCLUDES += $(GLIB_CFLAGS)

 UNINST_PROGRAMS = fswreck

-CFILES = main.c corrupt.c chain.c extent.c group.c inode.c
local_alloc.c truncate_log.c special.c symlink.c dir.c journal.c
quota.c refcount.c discontig_bg.c
+CFILES = main.c corrupt.c chain.c extent.c group.c inode.c
local_alloc.c truncate_log.c special.c symlink.c dir.c journal.c
quota.c refcount.c discontig_bg.c super.c

 HFILES = 			\
 	include/chain.h		\
diff --git a/fswreck/corrupt.c b/fswreck/corrupt.c
index aa76dcc..03e1acd 100644
--- a/fswreck/corrupt.c
+++ b/fswreck/corrupt.c
@@ -462,3 +462,10 @@ void corrupt_discontig_bg(ocfs2_filesys *fs, enum
fsck_type type,
 {
 	mess_up_discontig_bg(fs, type, slotnum);
 }
+
+void corrupt_super(ocfs2_filesys *fs, enum fsck_type type,
+		uint16_t slotnum)
+{
+	mess_up_super(fs, type);
+}
+
diff --git a/fswreck/include/corrupt.h b/fswreck/include/corrupt.h
index 0fb7193..70c4b95 100644
--- a/fswreck/include/corrupt.h
+++ b/fswreck/include/corrupt.h
@@ -37,5 +37,7 @@ void corrupt_truncate_log(ocfs2_filesys *fs, enum
fsck_type type,
 void corrupt_refcount(ocfs2_filesys *fs, enum fsck_type type,
uint16_t slotnum);
 void corrupt_discontig_bg(ocfs2_filesys *fs, enum fsck_type type,
 			  uint16_t slotnum);
+void corrupt_super(ocfs2_filesys *fs, enum fsck_type type,
+			  uint16_t slotnum);

 #endif		/* __CORRUPT_H */
diff --git a/fswreck/include/fsck_type.h b/fswreck/include/fsck_type.h
index e58d343..e15940b 100644
--- a/fswreck/include/fsck_type.h
+++ b/fswreck/include/fsck_type.h
@@ -162,6 +162,7 @@ enum fsck_type
 	REFCOUNT_REC_REDUNDANT,
 	REFCOUNT_COUNT_INVALID,
 	DUP_CLUSTERS_ADD_REFCOUNT,
+	SUPERBLOCK_INVALID_ECC,
 	NUM_FSCK_TYPE
 };

diff --git a/fswreck/include/main.h b/fswreck/include/main.h
index 3175305..5d94c46 100644
--- a/fswreck/include/main.h
+++ b/fswreck/include/main.h
@@ -92,5 +92,6 @@
 #include "quota.h"
 #include "refcount.h"
 #include "discontig_bg.h"
+#include "super.h"

 #endif		/* __MAIN_H__ */
diff --git a/fswreck/main.c b/fswreck/main.c
index b1b2fcb..1fffd37 100644
--- a/fswreck/main.c
+++ b/fswreck/main.c
@@ -316,6 +316,8 @@ static struct prompt_code prompt_codes[NUM_FSCK_TYPE] = {
 			   "corrupt extent rec for a discontig bg"),
 	define_prompt_code(DISCONTIG_BG_LEAF_CLUSTERS, corrupt_discontig_bg,
 			   "corrupt extent rec's clusters for a discontig bg"),
+	define_prompt_code(SUPERBLOCK_INVALID_ECC, corrupt_super,
+			   "corrupt superblock's ecc"),
 };

 #undef define_prompt_code
-- 
1.7.6



More information about the Ocfs2-tools-devel mailing list