[Cluster-devel] [fsck.gfs2 v2 PATCH 13/40] fsck.gfs2: Divest check_metatree from fsck_blockmap_set

Bob Peterson rpeterso at redhat.com
Fri May 6 17:39:06 UTC 2016


This patch replaces the call to function fsck_blockmap_set in
function check_metatree (which is used in all passes) to a
corresponding call to fsck_bitmap_set. This is another step to
having pass1 be the only function to manipulate the blockmap.

Signed-off-by: Bob Peterson <rpeterso at redhat.com>
---
 gfs2/fsck/metawalk.c | 4 ++--
 gfs2/fsck/pass1.c    | 7 ++++++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/gfs2/fsck/metawalk.c b/gfs2/fsck/metawalk.c
index 1f2bc10..529c86d 100644
--- a/gfs2/fsck/metawalk.c
+++ b/gfs2/fsck/metawalk.c
@@ -1604,8 +1604,8 @@ undo_metalist:
 	   to undo. */
 	delete_all_dups(ip);
 	/* Set the dinode as "bad" so it gets deleted */
-	fsck_blockmap_set(ip, ip->i_di.di_num.no_addr,
-			  _("corrupt"), GFS2_BLKST_FREE);
+	fsck_bitmap_set(ip, ip->i_di.di_num.no_addr, _("corrupt"),
+			GFS2_BLKST_FREE);
 	log_err(_("The corrupt inode was invalidated.\n"));
 out:
 	free_metalist(ip, &metalist[0]);
diff --git a/gfs2/fsck/pass1.c b/gfs2/fsck/pass1.c
index fbacfea..0ae842e 100644
--- a/gfs2/fsck/pass1.c
+++ b/gfs2/fsck/pass1.c
@@ -1304,9 +1304,14 @@ static void reprocess_inode(struct gfs2_inode *ip, const char *desc)
 		  (unsigned long long)ip->i_di.di_num.no_addr,
 		  ip->i_di.di_height);
 	error = check_metatree(ip, &alloc_fxns);
-	if (error)
+	if (error) {
+		/* check_metatree will have fixed the bitmap, but not the
+		   blockmap. */
+		gfs2_blockmap_set(bl, ip->i_di.di_num.no_addr,
+				  GFS2_BLKST_FREE);
 		log_err( _("Error %d reprocessing the %s metadata tree.\n"),
 			 error, desc);
+	}
 }
 
 /*
-- 
2.5.5




More information about the Cluster-devel mailing list