[Ocfs2-tools-devel] [PATCH 1/9] fsck.ocfs2: Remove the unused ost_bad_inodes bitmap.

Joel Becker joel.becker at oracle.com
Thu Jul 30 12:24:59 PDT 2009


We allocate a bitmap of bad inodes.  We test it in pass 2.  But we
never, ever set a bit in it.

It looks to be cloned from e2fsck.  In e2fsck, they don't fix invalid
inode fields in pass 1.  They just mark the inode in the bad map.
Later, in pass2, they test the bad map and fix the fields there.  The
advantage is that they can print a pathname.

That's a major rework for o2fsck, so we're just going to remove the
unused bad map for now.  If someone wants to add it back later, they
can.

Signed-off-by: Joel Becker <joel.becker at oracle.com>
---
 fsck.ocfs2/fsck.c         |   10 ----------
 fsck.ocfs2/include/fsck.h |    1 -
 fsck.ocfs2/pass2.c        |    8 --------
 3 files changed, 0 insertions(+), 19 deletions(-)

diff --git a/fsck.ocfs2/fsck.c b/fsck.ocfs2/fsck.c
index 5f1f2d1..df66075 100644
--- a/fsck.ocfs2/fsck.c
+++ b/fsck.ocfs2/fsck.c
@@ -166,13 +166,6 @@ static errcode_t o2fsck_state_init(ocfs2_filesys *fs, o2fsck_state *ost)
 		return ret;
 	}
 
-	ret = ocfs2_block_bitmap_new(fs, "inodes with bad fields", 
-				     &ost->ost_bad_inodes);
-	if (ret) {
-		com_err(whoami, ret, "while allocating bad inodes bitmap");
-		return ret;
-	}
-
 	ret = ocfs2_block_bitmap_new(fs, "directory inodes", 
 				     &ost->ost_dir_inodes);
 	if (ret) {
@@ -202,9 +195,6 @@ errcode_t o2fsck_state_reinit(ocfs2_filesys *fs, o2fsck_state *ost)
 {
 	errcode_t ret;
 
-	ocfs2_bitmap_free(ost->ost_bad_inodes);
-	ost->ost_bad_inodes = NULL;
-
 	ocfs2_bitmap_free(ost->ost_dir_inodes);
 	ost->ost_dir_inodes = NULL;
 
diff --git a/fsck.ocfs2/include/fsck.h b/fsck.ocfs2/include/fsck.h
index 28a3264..aec130d 100644
--- a/fsck.ocfs2/include/fsck.h
+++ b/fsck.ocfs2/include/fsck.h
@@ -33,7 +33,6 @@ typedef struct _o2fsck_state {
 	ocfs2_cached_inode	*ost_global_inode_alloc;
 	ocfs2_cached_inode	**ost_inode_allocs;
 
-	ocfs2_bitmap	*ost_bad_inodes;
 	ocfs2_bitmap	*ost_dir_inodes;
 	ocfs2_bitmap	*ost_reg_inodes;
 
diff --git a/fsck.ocfs2/pass2.c b/fsck.ocfs2/pass2.c
index 14b1911..810bf10 100644
--- a/fsck.ocfs2/pass2.c
+++ b/fsck.ocfs2/pass2.c
@@ -460,14 +460,6 @@ static errcode_t fix_dirent_filetype(o2fsck_state *ost,
 		goto check;
 	}
 
-	ret = ocfs2_bitmap_test(ost->ost_bad_inodes, dirent->inode, &was_set);
-	if (ret)
-		goto out;
-	if (was_set) {
-		expected_type = OCFS2_FT_UNKNOWN;
-		goto check;
-	}
-
 	ret = o2fsck_type_from_dinode(ost, dirent->inode, &expected_type);
 	if (ret)
 		goto out;
-- 
1.6.3.3




More information about the Ocfs2-tools-devel mailing list