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

tristan.ye tristan.ye at oracle.com
Sun Jun 28 18:46:25 PDT 2009


On Fri, 2009-06-26 at 10:27 -0700, Sunil Mushran wrote:
> Yeah. Good catch Tristan.
> 
> BTW, do you have a big endian machine to test this on?

Yes, I used ca-test41.us.oracle.com(ppc arch) for such testing.

> Wondering as we not only have ppcs, we also have some
> sessions on s390x that are not used regularly.

Have not tried the tests on s390x arch yet. all my local testing
machines in shenzhen and beijing are i386 or x86_64 cpus, is there any
box I can find in HQ testing servers which were s390x arch?

Tristan.


> 
> Tao Ma wrote:
> > 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)
> >>     
> >
> > _______________________________________________
> > Ocfs2-tools-devel mailing list
> > Ocfs2-tools-devel at oss.oracle.com
> > http://oss.oracle.com/mailman/listinfo/ocfs2-tools-devel
> >   
> 




More information about the Ocfs2-tools-devel mailing list