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

Joel Becker Joel.Becker at oracle.com
Thu Jul 2 14:08:03 PDT 2009


On Fri, Jun 26, 2009 at 11:46:12AM +0800, Tao Ma wrote:
> Oh, this is really a bug.
> SOB.

my sob too

> 
> 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

-- 

"What does it say about a society's priorities when the time you
 spend in meetings on Monday is greater than the total number of
 hours you spent sleeping over the weekend?"
	- Nat Friedman

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-tools-devel mailing list