[Ocfs2-tools-devel] [PATCH 2/4] Ocfs2-tools: Fix a minor bug of fswreck.

Tristan Ye tristan.ye at oracle.com
Thu Jun 25 19:49:20 PDT 2009


Should start the prompt code from index 0 in main program,it's obviously
a mistake here. The patch also add fprintf description for prompt
code(DUPLICATE_CLUSTERS).

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

diff --git a/fswreck/inode.c b/fswreck/inode.c
index 377ce08..70e849e 100644
--- a/fswreck/inode.c
+++ b/fswreck/inode.c
@@ -402,6 +402,11 @@ void mess_up_dup_clusters(ocfs2_filesys *fs, enum fsck_type type,
 	if (err)
 		FSWRK_COM_FATAL(progname, err);
 
+	fprintf(stdout, "DUPLICATE_CLUSTERS: "
+		"Create two inodes #%"PRIu64" and #%"PRIu64
+		" by allocating same cluster to them.",
+		inode1_blkno, inode2_blkno);
+
 	ocfs2_free(&buf);
 }
 
diff --git a/fswreck/main.c b/fswreck/main.c
index 27f79a6..ea15fb7 100644
--- a/fswreck/main.c
+++ b/fswreck/main.c
@@ -420,7 +420,7 @@ int main (int argc, char **argv)
 		goto bail;
 	}
 
-	for (i = 1; i < NUM_FSCK_TYPE; ++i) {
+	for (i = 0; i < NUM_FSCK_TYPE; ++i) {
 		if (corrupt[i]) {
 			if (prompt_codes[i].func)
 				prompt_codes[i].func(fs, prompt_codes[i].type,
-- 
1.5.5




More information about the Ocfs2-tools-devel mailing list