gfs2-utils: master - GFS2: fsck.gfs2 seems to process large files twice

Bob Peterson rpeterso at fedoraproject.org
Thu Sep 23 15:41:56 UTC 2010


Gitweb:        http://git.fedorahosted.org/git/gfs2-utils.git?p=gfs2-utils.git;a=commitdiff;h=afabf7e6c8547e9651ee8a168e5dc65675c76d8e
Commit:        afabf7e6c8547e9651ee8a168e5dc65675c76d8e
Parent:        8ef7be619e783c92bf75cbf4dfb8e7a05399c399
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:42:01 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 421a645..e3c0eff 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -1347,14 +1347,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 0aea38c..b891d1b 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -89,6 +89,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