[Ocfs2-tools-devel] [PATCH 08/15] dx_dirs v11: fsck.ocfs2 support

Mark Fasheh mfasheh at suse.com
Mon Apr 19 16:27:37 PDT 2010


On Mon, Apr 12, 2010 at 05:35:04PM -0700, Sunil Mushran wrote:
> Coly,
> 
> Any reason we are not prompting the user before rebuilding.
> Like we do before all other writes. Refer fsck.ocfs2.checks.8.

How does this look? I'm not prompting on the index rebuilds because those
are driven by changes made internally (which the user already agreed to).
	--Mark

--
Mark Fasheh

From: Mark Fasheh <mfasheh at suse.com>
Date: Mon, 19 Apr 2010 16:25:48 -0700

fsck.ocfs2: prompt before truncating an invalid dir index

Signed-off-by: Mark Fasheh <mfasheh at suse.com>
---
 fsck.ocfs2/fsck.ocfs2.checks.8.in |    6 ++++++
 fsck.ocfs2/pass2.c                |    6 +++++-
 2 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/fsck.ocfs2/fsck.ocfs2.checks.8.in b/fsck.ocfs2/fsck.ocfs2.checks.8.in
index 05561ae..5cda023 100644
--- a/fsck.ocfs2/fsck.ocfs2.checks.8.in
+++ b/fsck.ocfs2/fsck.ocfs2.checks.8.in
@@ -1055,6 +1055,12 @@ but fsck has already found quota limits for this user / group.
 
 Answering yes will use new values of limits for the user / group.
 
+.SS "IV_DX_TREE"
+A directory index was found on an inode but that feature is not enabled on the
+file system.
+
+Answering yes will truncate the invalid index.
+
 .SH "SEE ALSO"
 .BR fsck.ocfs2(8)
 
diff --git a/fsck.ocfs2/pass2.c b/fsck.ocfs2/pass2.c
index 58efcd4..b999761 100644
--- a/fsck.ocfs2/pass2.c
+++ b/fsck.ocfs2/pass2.c
@@ -874,7 +874,11 @@ next:
 	if ((!ocfs2_supports_indexed_dirs(OCFS2_RAW_SB(dd->fs->fs_super)))&&
 	     di->i_dyn_features & OCFS2_INDEXED_DIR_FL ) {
 		/* ignore the return value */
-		ocfs2_dx_dir_truncate(dd->fs, dbe->e_ino);
+		if (prompt(dd->ost, PY, PR_IV_DX_TREE, "A directory index was "
+			   "found on inode %"PRIu64" but the indexing feature "
+			   "is not set on the fs. Truncate the invalid index?",
+			   dbe->e_ino))
+			ocfs2_dx_dir_truncate(dd->fs, dbe->e_ino);
 	}
 
 out:
-- 
1.6.4.2




More information about the Ocfs2-tools-devel mailing list