cluster: RHEL6 - fsck.gfs2: fsck.gfs2: Find and clear duplicate leaf blocks refs

Bob Peterson rpeterso at fedoraproject.org
Tue Jan 24 20:45:42 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=95edb17a8a8312bc2e08c7ce8efc59b54bffda10
Commit:        95edb17a8a8312bc2e08c7ce8efc59b54bffda10
Parent:        01401b5167a5d2aa9b36a1dc4605ec07fca4db65
Author:        Bob Peterson <rpeterso at redhat.com>
AuthorDate:    Mon Aug 8 16:44:47 2011 -0500
Committer:     Bob Peterson <rpeterso at redhat.com>
CommitterDate: Fri Jan 20 08:26:26 2012 -0600

fsck.gfs2: fsck.gfs2: Find and clear duplicate leaf blocks refs

Duplicate references that were in leaf blocks were never found nor
cleared.  This patch adds that capability.

rhbz#675723
---
 gfs2/fsck/pass1b.c |   15 +++++++++++++--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/gfs2/fsck/pass1b.c b/gfs2/fsck/pass1b.c
index ce358c4..65e6de9 100644
--- a/gfs2/fsck/pass1b.c
+++ b/gfs2/fsck/pass1b.c
@@ -26,6 +26,7 @@ struct dup_handler {
 	int ref_count;
 };
 
+static int check_leaf(struct gfs2_inode *ip, uint64_t block, void *private);
 static int check_metalist(struct gfs2_inode *ip, uint64_t block,
 			  struct gfs2_buffer_head **bh, int h, void *private);
 static int check_data(struct gfs2_inode *ip, uint64_t block, void *private);
@@ -51,7 +52,7 @@ static int find_dentry(struct gfs2_inode *ip, struct gfs2_dirent *de,
 
 struct metawalk_fxns find_refs = {
 	.private = NULL,
-	.check_leaf = NULL,
+	.check_leaf = check_leaf,
 	.check_metalist = check_metalist,
 	.check_data = check_data,
 	.check_eattr_indir = check_eattr_indir,
@@ -73,6 +74,11 @@ struct metawalk_fxns find_dirents = {
 	.check_eattr_extentry = NULL,
 };
 
+static int check_leaf(struct gfs2_inode *ip, uint64_t block, void *private)
+{
+	return add_duplicate_ref(ip, block, ref_as_meta, 1, INODE_VALID);
+}
+
 static int check_metalist(struct gfs2_inode *ip, uint64_t block,
 			  struct gfs2_buffer_head **bh, int h, void *private)
 {
@@ -250,6 +256,11 @@ static int clear_dup_data(struct gfs2_inode *ip, uint64_t block, void *private)
 	return clear_dup_metalist(ip, block, NULL, 0, private);
 }
 
+static int clear_leaf(struct gfs2_inode *ip, uint64_t block, void *private)
+{
+	return clear_dup_metalist(ip, block, NULL, 0, private);
+}
+
 static int clear_dup_eattr_indir(struct gfs2_inode *ip, uint64_t block,
 				 uint64_t parent, struct gfs2_buffer_head **bh,
 				 void *private)
@@ -392,7 +403,7 @@ static int clear_a_reference(struct gfs2_sbd *sdp, struct duptree *b,
 	osi_list_t *tmp, *x;
 	struct metawalk_fxns clear_dup_fxns = {
 		.private = NULL,
-		.check_leaf = NULL,
+		.check_leaf = clear_leaf,
 		.check_metalist = clear_dup_metalist,
 		.check_data = clear_dup_data,
 		.check_eattr_indir = clear_dup_eattr_indir,


More information about the cluster-commits mailing list