ocfs2-tools/0015-fsck.ocfs2-prompt-before-truncating-an-invalid-dir-i.patch

49 lines
1.6 KiB
Diff

From ed44744701bd4eeaf5ee0fcce9190cdf36b5b21c Mon Sep 17 00:00:00 2001
From: Mark Fasheh <mfasheh@suse.com>
Date: Mon, 19 Apr 2010 16:25:48 -0700
Subject: [PATCH 15/30] fsck.ocfs2: prompt before truncating an invalid dir index
Signed-off-by: Mark Fasheh <mfasheh@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.7.0.2