[Ocfs2-devel] [PATCH] tailtest: Add a test for the tail zeroing bug
    Joel Becker 
    Joel.Becker at oracle.com
       
    Tue Jul  6 05:02:55 PDT 2010
    
    
  
On Tue, Jul 06, 2010 at 03:45:50PM +0800, tristan wrote:
> Hi Joel,
> 
> I'm totally trusting the logic of your testcase to test tail zeroing.
> 
> Just two concerns as follows:
> 
> 1. It should be better to make the script runnable for none-privilege 
> users for the sake of security concerns.
	Can't mount without root privileges, and the test requires
umount/mount cycles to expose the problem.  I wish I had a better
answer too.
> 2. Why not make variations with different bs and cs combinations
	This is a good idea for completeness, but I don't want to spend
the time on that right now.  I picked a bs/cs combination that was sure
to expose the bug as we know it.
> > +cleanup()
> > +{
> > +    [ -d "$_MOUNTPOINT" ] && umount "$_MOUNTPOINT"
> > +    [ -d "$_MOUNTPOINT" ] && rmdir "$_MOUNTPOINT"
> > +    [ -n "$_LOOP" ] && losetup -d "$_LOOP"
> > +    [ -n "$_IMAGE" ] && rm -f "$_IMAGE"
> 
> You may also need to cleanup expected template files for comparison? if 
> the test aborts abnormally.
	The template files are on the test filesystem.  They go away
when we remove the image.
> or rmdir never succeeds. I guess using "rm -rf $MOUNTPOINT" here will be 
> more aggressive to handle this.
	There's nothing under the mountpoint after we've unmounted.
that's why I use rmdir and not rm -rf.
Joel
-- 
"Under capitalism, man exploits man.  Under Communism, it's just 
   the opposite."
				 - John Kenneth Galbraith
Joel Becker
Consulting Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
    
    
More information about the Ocfs2-devel
mailing list