[Ocfs2-tools-devel] [PATCH] Fix - fsck.ocfs2 attempts to clear dx_dir blocks

Tao Ma tao.ma at oracle.com
Wed Sep 8 22:35:52 PDT 2010



On 09/08/2010 04:08 AM, Goldwyn Rodrigues wrote:
> 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>
ack and I will commit it in.
the ocfs2-tools support for indexed-dir(done by coly and Mark) and 
refcount(done by I) are carried out in the same time, so we must forget 
to check with each others. Thanks.

Regards,
Tao
> ---
> 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);
>



More information about the Ocfs2-tools-devel mailing list