[Ocfs2-tools-devel] [PATCH 11/11] Ocfs2-tools: Fix bug for EXTENT_EB_INVALID corruptor.

Tristan Ye tristan.ye at oracle.com
Tue Jun 9 01:02:50 PDT 2009


The fswreck EXTENT_EB_INVALID corrupter actually does EB_GEN.
But the wrong fsck choice can make this not exercise the EXTENT_EB_INVALID.
The corrupter for EXTENT_EB_INVALID therefore should corrupt the extent
block's signature instead.

Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
---
 fswreck/extent.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fswreck/extent.c b/fswreck/extent.c
index c0550b8..e3fe020 100644
--- a/fswreck/extent.c
+++ b/fswreck/extent.c
@@ -164,7 +164,6 @@ static void damage_extent_block(ocfs2_filesys *fs, uint64_t blkno,
 			break;
 		case EB_GEN:
 		case EB_GEN_FIX:
-		case EXTENT_EB_INVALID:
 			oldno = eb->h_fs_generation;
 			eb->h_fs_generation = 0x1234;
 			if (type == EB_GEN)
@@ -177,6 +176,12 @@ static void damage_extent_block(ocfs2_filesys *fs, uint64_t blkno,
 				"generation number from 0x%x to 0x%x\n",
 				blkno, oldno, eb->h_fs_generation);
 			break;
+		case EXTENT_EB_INVALID:
+			memset(eb->h_signature, 'a', sizeof(eb->h_signature));
+			fprintf(stdout, "Corrupt the signature of extent block "
+				"%"PRIu64"\n",
+				eb->h_blkno);
+			break;
 		case EXTENT_LIST_DEPTH: 
 			oldno = eb->h_list.l_tree_depth;
 			eb->h_list.l_tree_depth += 1;
-- 
1.5.5




More information about the Ocfs2-tools-devel mailing list