cluster: RHEL6 - GFS2: fsck.gfs2 seems to process large files twice

Bob Peterson rpeterso at fedoraproject.org
Thu Sep 23 15:43:55 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=4548cf064eca28c59e12d7b88ed3ded193907c98
Commit:        4548cf064eca28c59e12d7b88ed3ded193907c98
Parent:        f230a400c7b99d9cc95e19ab6fdca9fcd64811ee
Author:        Bob Peterson <rpeterso at redhat.com>
AuthorDate:    Thu Sep 23 10:33:06 2010 -0500
Committer:     Bob Peterson <rpeterso at redhat.com>
CommitterDate: Thu Sep 23 10:38:25 2010 -0500

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 = {


More information about the cluster-commits mailing list