File fsck_gfs2_seems_to_process_large_files_twice.patch of Package cluster

From 4548cf064eca28c59e12d7b88ed3ded193907c98 Mon Sep 17 00:00:00 2001
From: Bob Peterson <rpeterso@redhat.com>
Date: Thu, 23 Sep 2010 10:33:06 -0500
Subject: [PATCH] GFS2: fsck.gfs2 seems to process large files twice

This patch allows each pass to define its own callback function for
reporting its progress for large files.  The initial pass through the
metadata made by pass1 as a sanity check has no such callback so
pass1 will stop reporting its progress through the file twice.

rhbz#621313
---
 gfs2/fsck/metawalk.c |    6 +++---
 gfs2/fsck/metawalk.h |    1 +
 gfs2/fsck/pass1.c    |    1 +
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 2151ced..ff348e4 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -1345,14 +1345,14 @@ int check_metatree(struct gfs2_inode *ip, struct metawalk_fxns *pass)
 
 		if (rc && (!error || rc < 0))
 			error = rc;
-		if (ip->i_di.di_blocks > COMFORTABLE_BLKS)
-			big_file_comfort(ip, blks_checked);
+		if (pass->big_file_msg && ip->i_di.di_blocks > COMFORTABLE_BLKS)
+			pass->big_file_msg(ip, blks_checked);
 		if (bh == ip->i_bh)
 			osi_list_del(&bh->b_altlist);
 		else
 			brelse(bh);
 	}
-	if (ip->i_di.di_blocks > COMFORTABLE_BLKS) {
+	if (pass->big_file_msg && ip->i_di.di_blocks > COMFORTABLE_BLKS) {
 		log_notice( _("\rLarge file at %lld (0x%llx) - 100 percent "
 			      "complete.                                   "
 			      "\n"),
diff --git a/gfs2/fsck/metawalk.h b/gfs2/fsck/metawalk.h
index 7aae9f2..3ee12fe 100644
--- a/gfs2/fsck/metawalk.h
+++ b/gfs2/fsck/metawalk.h
@@ -89,6 +89,7 @@ struct metawalk_fxns {
 				     void *private);
 	int (*finish_eattr_indir) (struct gfs2_inode *ip, int leaf_pointers,
 				   int leaf_pointer_errors, void *private);
+	void (*big_file_msg) (struct gfs2_inode *ip, uint64_t blks_checked);
 };
 
 #endif /* _METAWALK_H */
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index bc500fd..6613bd1 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -87,6 +87,7 @@ struct metawalk_fxns pass1_fxns = {
 	.check_eattr_entry = check_eattr_entries,
 	.check_eattr_extentry = check_extended_leaf_eattr,
 	.finish_eattr_indir = finish_eattr_indir,
+	.big_file_msg = big_file_comfort,
 };
 
 struct metawalk_fxns undo_fxns = {
-- 
1.7.2.3