[Ocfs2-tools-devel] [PATCH] Fix - fsck.ocfs2 attempts to clear dx_dir blocks
Goldwyn Rodrigues
rgoldwyn at gmail.com
Tue Sep 7 13:08:31 PDT 2010
If a directory has dx_dir blocks, fsck attempts to clear them in global bitmap.
Steps to reproduce:
Make filesystem with indexed-dirs feature enabled. Make a directory and create
a lot of files in it. Run fsck.ocfs2 -f on this filesystem.
This fix accounts for the dx_leaf nodes and avoids clearing in global bitmap.
The patch reuses the normal file extent functions, which includes code
for refcounting which might not be relevant in this situation.
Signed-off-by: Goldwyn Rodrigues <rgoldwyn at suse.de>
---
diff --git a/fsck.ocfs2/pass1.c b/fsck.ocfs2/pass1.c
index b53b908..22dafdf 100644
--- a/fsck.ocfs2/pass1.c
+++ b/fsck.ocfs2/pass1.c
@@ -809,6 +809,10 @@ static errcode_t o2fsck_check_dx_dir(o2fsck_state
*ost, struct ocfs2_dinode *di)
if (dx_root->dr_flags & OCFS2_DX_FLAG_INLINE)
goto out;
+ ei.chk_rec_func = o2fsck_check_extent_rec;
+ ei.mark_rec_alloc_func = o2fsck_mark_tree_clusters_allocated;
+ ei.para = di;
+
ret = check_el(ost, &ei, di->i_blkno, &dx_root->dr_list,
ocfs2_extent_recs_per_dx_root(fs->fs_blocksize),
&changed);
--
Goldwyn
More information about the Ocfs2-tools-devel
mailing list