public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfstests 271: use xfs_io to truncate file instead of truncate(1)
@ 2012-01-10 16:37 Eryu Guan
  2012-01-10 16:37 ` [PATCH] xfstests 273: Create lost+found to pass _check_scratch_fs Eryu Guan
  2012-01-11 11:46 ` [PATCH] xfstests 271: use xfs_io to truncate file instead of truncate(1) Christoph Hellwig
  0 siblings, 2 replies; 5+ messages in thread
From: Eryu Guan @ 2012-01-10 16:37 UTC (permalink / raw)
  To: xfs; +Cc: Eryu Guan

Distros(eg. RHEL5) with older version of coreutils have no truncate(1)
command. Use xfs_io instead to avoid "command not found" failures.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
---
 271 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/271 b/271
index 58a7f91..b96d702 100755
--- a/271
+++ b/271
@@ -55,7 +55,7 @@ do
     dd if=/dev/zero of=$SCRATCH_MNT/file bs=4k count=1 seek=$((i*10))
 done
 # truncate last extent
-truncate $SCRATCH_MNT/file --size $((4096* 200))
+$XFS_IO_PROG -F -f -c "truncate $((4096*200))" $SCRATCH_MNT/file
 
 if ! _scratch_unmount; then
 	echo "failed to umount"
-- 
1.7.8.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH] xfstests 273: Create lost+found to pass _check_scratch_fs
  2012-01-10 16:37 [PATCH] xfstests 271: use xfs_io to truncate file instead of truncate(1) Eryu Guan
@ 2012-01-10 16:37 ` Eryu Guan
  2012-01-10 22:02   ` Dave Chinner
  2012-01-11 11:46 ` [PATCH] xfstests 271: use xfs_io to truncate file instead of truncate(1) Christoph Hellwig
  1 sibling, 1 reply; 5+ messages in thread
From: Eryu Guan @ 2012-01-10 16:37 UTC (permalink / raw)
  To: xfs; +Cc: Eryu Guan

fsck.extN will complain lost+found is missing and fail 273.
So create lost+found explicitly after removing everything in
$SCRATCH_MNT.

Signed-off-by: Eryu Guan <guaneryu@gmail.com>
---
 273 |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/273 b/273
index 2965132..9ecb2d3 100755
--- a/273
+++ b/273
@@ -36,6 +36,7 @@ _cleanup()
 {
 	cd /
 	rm -rf $SCRATCH_MNT/* $tmp.*
+	mkdir -p $SCRATCH_MNT/lost+found
 	_scratch_unmount
 }
 
@@ -107,6 +108,7 @@ _do_workload()
 	_pid=1
 	
 	rm -rf $SCRATCH_MNT/*
+	mkdir -p $SCRATCH_MNT/lost+found
 
 	_threads_set
 	_file_create
-- 
1.7.8.2

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfstests 273: Create lost+found to pass _check_scratch_fs
  2012-01-10 16:37 ` [PATCH] xfstests 273: Create lost+found to pass _check_scratch_fs Eryu Guan
@ 2012-01-10 22:02   ` Dave Chinner
  2012-01-12 17:24     ` Eryu Guan
  0 siblings, 1 reply; 5+ messages in thread
From: Dave Chinner @ 2012-01-10 22:02 UTC (permalink / raw)
  To: Eryu Guan; +Cc: xfs

On Wed, Jan 11, 2012 at 12:37:49AM +0800, Eryu Guan wrote:
> fsck.extN will complain lost+found is missing and fail 273.
> So create lost+found explicitly after removing everything in
> $SCRATCH_MNT.

I'd consider that a bug in e2fsck. Other filesystems handle missing
lost+found directories without failing, but then again it's only
these new tests that do this so fixing the tests is probably the
right thing to do here.

> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
> ---
>  273 |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/273 b/273
> index 2965132..9ecb2d3 100755
> --- a/273
> +++ b/273
> @@ -36,6 +36,7 @@ _cleanup()
>  {
>  	cd /
>  	rm -rf $SCRATCH_MNT/* $tmp.*
> +	mkdir -p $SCRATCH_MNT/lost+found
>  	_scratch_unmount
>  }

We shouldn't be removing files from the scratch device  in the
_cleanup function - if the test exits or fails, we need the corpse
to be intact for debugging. Remving $SCRATCH_MNT/* from the rm
command is what should be done here.

>  
> @@ -107,6 +108,7 @@ _do_workload()
>  	_pid=1
>  	
>  	rm -rf $SCRATCH_MNT/*
> +	mkdir -p $SCRATCH_MNT/lost+found

And rather than doing this, the test should put all it's files in a
known location on the $SCRATCH_MNT and just remove that. e.g:

WORK_DIR="$SCRATCH_MNT/$seq"

....

	rm -rf $WORKDIR

....

The same fixes are required for 274 and 275 as well.

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfstests 271: use xfs_io to truncate file instead of truncate(1)
  2012-01-10 16:37 [PATCH] xfstests 271: use xfs_io to truncate file instead of truncate(1) Eryu Guan
  2012-01-10 16:37 ` [PATCH] xfstests 273: Create lost+found to pass _check_scratch_fs Eryu Guan
@ 2012-01-11 11:46 ` Christoph Hellwig
  1 sibling, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2012-01-11 11:46 UTC (permalink / raw)
  To: Eryu Guan; +Cc: xfs

On Wed, Jan 11, 2012 at 12:37:48AM +0800, Eryu Guan wrote:
> Distros(eg. RHEL5) with older version of coreutils have no truncate(1)
> command. Use xfs_io instead to avoid "command not found" failures.

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] xfstests 273: Create lost+found to pass _check_scratch_fs
  2012-01-10 22:02   ` Dave Chinner
@ 2012-01-12 17:24     ` Eryu Guan
  0 siblings, 0 replies; 5+ messages in thread
From: Eryu Guan @ 2012-01-12 17:24 UTC (permalink / raw)
  To: Dave Chinner; +Cc: xfs

On Wed, Jan 11, 2012 at 6:02 AM, Dave Chinner <david@fromorbit.com> wrote:
> On Wed, Jan 11, 2012 at 12:37:49AM +0800, Eryu Guan wrote:
>> fsck.extN will complain lost+found is missing and fail 273.
>> So create lost+found explicitly after removing everything in
>> $SCRATCH_MNT.
>
> I'd consider that a bug in e2fsck. Other filesystems handle missing
> lost+found directories without failing, but then again it's only
> these new tests that do this so fixing the tests is probably the
> right thing to do here.
>
>> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
>> ---
>>  273 |    2 ++
>>  1 files changed, 2 insertions(+), 0 deletions(-)
>>
>> diff --git a/273 b/273
>> index 2965132..9ecb2d3 100755
>> --- a/273
>> +++ b/273
>> @@ -36,6 +36,7 @@ _cleanup()
>>  {
>>       cd /
>>       rm -rf $SCRATCH_MNT/* $tmp.*
>> +     mkdir -p $SCRATCH_MNT/lost+found
>>       _scratch_unmount
>>  }
>
> We shouldn't be removing files from the scratch device  in the
> _cleanup function - if the test exits or fails, we need the corpse
> to be intact for debugging. Remving $SCRATCH_MNT/* from the rm
> command is what should be done here.
>
>>
>> @@ -107,6 +108,7 @@ _do_workload()
>>       _pid=1
>>
>>       rm -rf $SCRATCH_MNT/*
>> +     mkdir -p $SCRATCH_MNT/lost+found
>
> And rather than doing this, the test should put all it's files in a
> known location on the $SCRATCH_MNT and just remove that. e.g:
>
> WORK_DIR="$SCRATCH_MNT/$seq"
>
> ....
>
>        rm -rf $WORKDIR
>
> ....
>
> The same fixes are required for 274 and 275 as well.

Thanks for the review, I just sent a new patch to fix 273 274 and 275
[PATCH] xfstests 273 274 275: do test in dedicated dir and leave test
files in it

Please help review.

Thanks,
Eryu Guan
>
> Cheers,
>
> Dave.
> --
> Dave Chinner
> david@fromorbit.com

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-01-12 17:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-10 16:37 [PATCH] xfstests 271: use xfs_io to truncate file instead of truncate(1) Eryu Guan
2012-01-10 16:37 ` [PATCH] xfstests 273: Create lost+found to pass _check_scratch_fs Eryu Guan
2012-01-10 22:02   ` Dave Chinner
2012-01-12 17:24     ` Eryu Guan
2012-01-11 11:46 ` [PATCH] xfstests 271: use xfs_io to truncate file instead of truncate(1) Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox