[Ocfs2-tools-devel] [PATCH] fsck.ocfs2: Avoid refcount a system file.

Tao Ma tao.ma at oracle.com
Sun Aug 15 20:02:43 PDT 2010


In pass1d, we try to adding refcount record for a multiple
claimed clusters first. But if the cluster is found in a
system file, we shouldn't try to add refcount for it and
the old method should be carried out.

Signed-off-by: Tao Ma <tao.ma at oracle.com>
---
 fsck.ocfs2/pass1b.c |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/fsck.ocfs2/pass1b.c b/fsck.ocfs2/pass1b.c
index 3ca1d7d..2849838 100644
--- a/fsck.ocfs2/pass1b.c
+++ b/fsck.ocfs2/pass1b.c
@@ -1025,8 +1025,9 @@ static int print_func(struct dup_cluster *dc, struct dup_inode *di,
 /*
  * Check whether we can create refcount for the file.
  * So a file is valid only if:
- * 1. It has no refcount tree.
- * 2. It has the same tree as others.
+ * 1. It isn't a system file.
+ * 2. It has no refcount tree.
+ * 3. It has the same tree as others.
  * Store refcount_loc if we find one.
  *
  * if there is other file that does't have the same tree, set refcount_loc
@@ -1037,6 +1038,11 @@ static int find_refcount_func(struct dup_cluster *dc, struct dup_inode *di,
 {
 	uint64_t *refcount_loc = priv_data;
 
+	if (di->di_flags & OCFS2_SYSTEM_FL) {
+		*refcount_loc = UINT64_MAX;
+		return 1;
+	}
+
 	if (!di->di_refcount_loc)
 		return 0;
 
-- 
1.7.1.GIT




More information about the Ocfs2-tools-devel mailing list