[Ocfs2-tools-devel] [PATCH 4/4] Ocfs2-tools: Fix bug in fswreck to let LALLOC_* prompt codes behave correctly.

Tao Ma tao.ma at oracle.com
Thu Jun 25 20:46:12 PDT 2009


Oh, this is really a bug.
SOB.

Tristan Ye wrote:
> Joel,
> 
> I've tested your patch '[PATCH] libocfs2: Prevent endian swapping
> from scribbling over memory', it resolves almost all of the failure
> fswreck hit in ppc arch, However, some prompt codes in fswreck still
> failed with your patch, cause the problem was in fswreck's code.
> 
> We don't need to swap the inode's field after reading the block from
> disk in fswreck's code, since it has been done by ocfs2_read_inode()
> in libocfs2. this patch help following prompt codes survive from failure
> in big-endian system.
> 
> 	LALLOC_BM_SIZE
> 	LALLOC_BM_OVERRUN
> 	LALLOC_BM_STRADDL
> 	LALLOC_USED_OVERRUN
> 	LALLOC_CLEAR
> 
> Signed-off-by: Tristan Ye <tristan.ye at oracle.com>
> ---
>  fswreck/local_alloc.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fswreck/local_alloc.c b/fswreck/local_alloc.c
> index b95efcc..eb9187e 100644
> --- a/fswreck/local_alloc.c
> +++ b/fswreck/local_alloc.c
> @@ -87,10 +87,10 @@ static void create_local_alloc(ocfs2_filesys *fs, uint64_t blkno)
>  
>  	la = &(di->id2.i_lab);
>  
> -	la->la_bm_off = cpu_to_le32(la_off);
> -	di->id1.bitmap1.i_total = cpu_to_le32(la_size);
> +	la->la_bm_off = la_off;
> +	di->id1.bitmap1.i_total = la_size;
>  	di->id1.bitmap1.i_used = 0;
> -	memset(la->la_bitmap, 0, le16_to_cpu(la->la_size));
> +	memset(la->la_bitmap, 0, la->la_size);
>  	
>  	ret = ocfs2_write_inode(fs, blkno, buf);
>  	if (ret)



More information about the Ocfs2-tools-devel mailing list