All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/299: various fixes
@ 2014-12-11 10:49 Eryu Guan
  2014-12-11 10:58 ` [PATCH v2] " Eryu Guan
  0 siblings, 1 reply; 9+ messages in thread
From: Eryu Guan @ 2014-12-11 10:49 UTC (permalink / raw)
  To: fstests; +Cc: Eryu Guan

Fix three problems in generic/299

1. Use $XFS_IO_PROG instead of fallocate/truncate, old distros like
RHEL5 don't have these commands.

2. Remove $seqres.full before test, otherwise the file is growing all
the time.

3. Make sure fio really exits, otherwise fio would block umount. $pid is
the pid of function run_check not fio, sometimes fio is still there when
$pid is dead and blocking umount.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---
 tests/generic/299 | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/generic/299 b/tests/generic/299
index e8685a4..ae1bf74 100755
--- a/tests/generic/299
+++ b/tests/generic/299
@@ -125,20 +125,23 @@ _workout()
 	do
 	    for ((k=1; k <= NUM_JOBS; k++))
 	    do
-		fallocate -l $FILE_SIZE $SCRATCH_MNT/direct_aio.$k.0 \
+		$XFS_IO_PROG -f -c "falloc 0 $FILE_SIZE" $SCRATCH_MNT/direct_aio.$k.0 \
 			>> $seqres.full 2>&1
 	    done
 	    for ((k=1; k <= NUM_JOBS; k++))
 	    do
-		truncate -s 0 $SCRATCH_MNT/direct_aio.$k.0 >> $seqres.full 2>&1
+		$XFS_IO_PROG -f -c "truncate 0" $SCRATCH_MNT/direct_aio.$k.0 \
+			>>$seqres.full 2>&1
 	    done
 	    # Following like will check that pid is still run.
 	    # Once fio exit we can stop fallocate/truncate loop
-	    kill -0 $pid > /dev/null 2>&1 || break
+	    pgrep fio >/dev/null 2>&1 || break
 	done
 	wait $pid
 }
 
+rm -f $seqres.full
+
 _scratch_mkfs >> $seqres.full 2>&1
 _scratch_mount
 
-- 
1.8.3.1


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

* [PATCH v2] generic/299: various fixes
  2014-12-11 10:49 [PATCH] generic/299: various fixes Eryu Guan
@ 2014-12-11 10:58 ` Eryu Guan
  2014-12-11 23:50   ` Dave Chinner
  2014-12-12  4:43   ` [PATCH v3] " Eryu Guan
  0 siblings, 2 replies; 9+ messages in thread
From: Eryu Guan @ 2014-12-11 10:58 UTC (permalink / raw)
  To: fstests; +Cc: Eryu Guan

Fix three problems in generic/299

1. Use $XFS_IO_PROG instead of fallocate/truncate, old distros like
RHEL5 don't have these commands.

2. Remove $seqres.full before test, otherwise the file is growing all
the time.

3. Make sure fio really exits, otherwise fio would block umount. $pid is
the pid of function run_check not fio, sometimes fio is still there when
$pid is dead and blocking umount.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---

v2:
- remove $seqres.full before _require_fio, which writes to $seqres.full too

 tests/generic/299 | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/tests/generic/299 b/tests/generic/299
index e8685a4..7d0fb5b 100755
--- a/tests/generic/299
+++ b/tests/generic/299
@@ -109,6 +109,8 @@ rw=randrw
 filename=buffered-aio-verifier
 EOF
 
+rm -f $seqres.full
+
 _require_fio $fio_config
 
 _workout()
@@ -125,16 +127,17 @@ _workout()
 	do
 	    for ((k=1; k <= NUM_JOBS; k++))
 	    do
-		fallocate -l $FILE_SIZE $SCRATCH_MNT/direct_aio.$k.0 \
+		$XFS_IO_PROG -f -c "falloc 0 $FILE_SIZE" $SCRATCH_MNT/direct_aio.$k.0 \
 			>> $seqres.full 2>&1
 	    done
 	    for ((k=1; k <= NUM_JOBS; k++))
 	    do
-		truncate -s 0 $SCRATCH_MNT/direct_aio.$k.0 >> $seqres.full 2>&1
+		$XFS_IO_PROG -f -c "truncate 0" $SCRATCH_MNT/direct_aio.$k.0 \
+			>>$seqres.full 2>&1
 	    done
 	    # Following like will check that pid is still run.
 	    # Once fio exit we can stop fallocate/truncate loop
-	    kill -0 $pid > /dev/null 2>&1 || break
+	    pgrep fio >/dev/null 2>&1 || break
 	done
 	wait $pid
 }
-- 
1.8.3.1


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

* Re: [PATCH v2] generic/299: various fixes
  2014-12-11 10:58 ` [PATCH v2] " Eryu Guan
@ 2014-12-11 23:50   ` Dave Chinner
  2014-12-12  2:51     ` Eryu Guan
  2014-12-12  4:43   ` [PATCH v3] " Eryu Guan
  1 sibling, 1 reply; 9+ messages in thread
From: Dave Chinner @ 2014-12-11 23:50 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests

On Thu, Dec 11, 2014 at 06:58:49PM +0800, Eryu Guan wrote:
> Fix three problems in generic/299
> 
> 1. Use $XFS_IO_PROG instead of fallocate/truncate, old distros like
> RHEL5 don't have these commands.
> 
> 2. Remove $seqres.full before test, otherwise the file is growing all
> the time.
> 
> 3. Make sure fio really exits, otherwise fio would block umount. $pid is
> the pid of function run_check not fio, sometimes fio is still there when
> $pid is dead and blocking umount.
> 
> Signed-off-by: Eryu Guan <eguan@redhat.com>
> ---
> 
> v2:
> - remove $seqres.full before _require_fio, which writes to $seqres.full too

Does not apply after Eric's earlier patch "[PATCH] use xfs_io
falloc, not fallocate". Once I push out an updated tree with this
patch in it, can you rebase this patch and resend it?

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

* Re: [PATCH v2] generic/299: various fixes
  2014-12-11 23:50   ` Dave Chinner
@ 2014-12-12  2:51     ` Eryu Guan
  0 siblings, 0 replies; 9+ messages in thread
From: Eryu Guan @ 2014-12-12  2:51 UTC (permalink / raw)
  To: Dave Chinner; +Cc: fstests

On Fri, Dec 12, 2014 at 10:50:53AM +1100, Dave Chinner wrote:
> On Thu, Dec 11, 2014 at 06:58:49PM +0800, Eryu Guan wrote:
> > Fix three problems in generic/299
> > 
> > 1. Use $XFS_IO_PROG instead of fallocate/truncate, old distros like
> > RHEL5 don't have these commands.
> > 
> > 2. Remove $seqres.full before test, otherwise the file is growing all
> > the time.
> > 
> > 3. Make sure fio really exits, otherwise fio would block umount. $pid is
> > the pid of function run_check not fio, sometimes fio is still there when
> > $pid is dead and blocking umount.
> > 
> > Signed-off-by: Eryu Guan <eguan@redhat.com>
> > ---
> > 
> > v2:
> > - remove $seqres.full before _require_fio, which writes to $seqres.full too
> 
> Does not apply after Eric's earlier patch "[PATCH] use xfs_io
> falloc, not fallocate". Once I push out an updated tree with this
> patch in it, can you rebase this patch and resend it?

Sure, will rebase and resend once the tree is updated.

Thanks,
Eryu

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

* [PATCH v3] generic/299: various fixes
  2014-12-11 10:58 ` [PATCH v2] " Eryu Guan
  2014-12-11 23:50   ` Dave Chinner
@ 2014-12-12  4:43   ` Eryu Guan
  2014-12-14 22:12     ` Theodore Ts'o
  2014-12-15  5:02     ` [PATCH v4] " Eryu Guan
  1 sibling, 2 replies; 9+ messages in thread
From: Eryu Guan @ 2014-12-12  4:43 UTC (permalink / raw)
  To: fstests; +Cc: Eryu Guan

Fix two problems in generic/299

1. Remove $seqres.full before test, otherwise the file is growing all
the time.

2. Make sure fio really exits, otherwise fio would block umount. $pid is
the pid of function run_check not fio, sometimes fio is still there when
$pid is dead and blocking umount.

Signed-off-by: Eryu Guan <eguan@redhat.com>
---

v3:
- rebase and skip the replacing fallocate/truncate part

v2:
- remove $seqres.full before _require_fio, which writes to $seqres.full too

 tests/generic/299 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/generic/299 b/tests/generic/299
index e49eba9..e5de45b 100755
--- a/tests/generic/299
+++ b/tests/generic/299
@@ -109,6 +109,8 @@ rw=randrw
 filename=buffered-aio-verifier
 EOF
 
+rm -f $seqres.full
+
 _require_fio $fio_config
 _require_xfs_io_command "falloc"
 
@@ -136,7 +138,7 @@ _workout()
 	    done
 	    # Following like will check that pid is still run.
 	    # Once fio exit we can stop fallocate/truncate loop
-	    kill -0 $pid > /dev/null 2>&1 || break
+	    pgrep fio > /dev/null 2>&1 || break
 	done
 	wait $pid
 }
-- 
2.1.0


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

* Re: [PATCH v3] generic/299: various fixes
  2014-12-12  4:43   ` [PATCH v3] " Eryu Guan
@ 2014-12-14 22:12     ` Theodore Ts'o
  2014-12-14 22:17       ` Theodore Ts'o
  2014-12-15  5:02     ` [PATCH v4] " Eryu Guan
  1 sibling, 1 reply; 9+ messages in thread
From: Theodore Ts'o @ 2014-12-14 22:12 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests

On Fri, Dec 12, 2014 at 12:43:21PM +0800, Eryu Guan wrote:
> @@ -136,7 +138,7 @@ _workout()
>  	    done
>  	    # Following like will check that pid is still run.
>  	    # Once fio exit we can stop fallocate/truncate loop
> -	    kill -0 $pid > /dev/null 2>&1 || break
> +	    pgrep fio > /dev/null 2>&1 || break
>  	done
>  	wait $pid

This patch is causing generic/299 to loop forever for me.  The problem
is that "fio" is too easy to match:

root@kvm-xfstests:~# pgrep fio
1407
root@kvm-xfstests:~# ps augxww | grep 1407
root      1407  0.0  0.0      0     0 ?        S<   16:52   0:00 [dm_bufio_cache]
root      8386  0.0  0.0   2704   492 ttyS1    S+   17:06   0:00 grep 1407

I'm currently a testing a patch which uses "pgrep -f $XFS_IO_PROG"
instead, but I'm a bit surprised no once else noticed this, I guess
people aren't building their xfstests test kernels with DM_SNAPSHOP or
DM_VERITY configured (either of which will seleect DM_BUFIO)?

	  	     	     	      	   - Ted

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

* Re: [PATCH v3] generic/299: various fixes
  2014-12-14 22:12     ` Theodore Ts'o
@ 2014-12-14 22:17       ` Theodore Ts'o
  2014-12-15  3:52         ` Eryu Guan
  0 siblings, 1 reply; 9+ messages in thread
From: Theodore Ts'o @ 2014-12-14 22:17 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests

On Sun, Dec 14, 2014 at 05:12:21PM -0500, Theodore Ts'o wrote:
> I'm currently a testing a patch which uses "pgrep -f $XFS_IO_PROG"
> instead, but I'm a bit surprised no once else noticed this, I guess
> people aren't building their xfstests test kernels with DM_SNAPSHOP or
> DM_VERITY configured (either of which will seleect DM_BUFIO)?

Ah, right, this hasn't gone upstream yet; I had just pulled it in
because I was seeing the problem with the umount hanging and killing
my test runs.

Anyway, Eryu, I'd suggest you resend your patch with the following
change, which seems to fix things up for me.

And with this patch included, feel free to add:

Reviewed-by: Theodore Ts'o <tytso@mit.edu>

	      	       	   	     	 - Ted

diff --git a/tests/generic/299 b/tests/generic/299
index e5de45b..9b99a66 100755
--- a/tests/generic/299
+++ b/tests/generic/299
@@ -138,7 +138,7 @@ _workout()
 	    done
 	    # Following like will check that pid is still run.
 	    # Once fio exit we can stop fallocate/truncate loop
-	    pgrep fio > /dev/null 2>&1 || break
+	    pgrep -f $XFS_IO_PROG > /dev/null 2>&1 || break
 	done
 	wait $pid
 }

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

* Re: [PATCH v3] generic/299: various fixes
  2014-12-14 22:17       ` Theodore Ts'o
@ 2014-12-15  3:52         ` Eryu Guan
  0 siblings, 0 replies; 9+ messages in thread
From: Eryu Guan @ 2014-12-15  3:52 UTC (permalink / raw)
  To: Theodore Ts'o; +Cc: fstests

On Sun, Dec 14, 2014 at 05:17:13PM -0500, Theodore Ts'o wrote:
> On Sun, Dec 14, 2014 at 05:12:21PM -0500, Theodore Ts'o wrote:
> > I'm currently a testing a patch which uses "pgrep -f $XFS_IO_PROG"
> > instead, but I'm a bit surprised no once else noticed this, I guess
> > people aren't building their xfstests test kernels with DM_SNAPSHOP or
> > DM_VERITY configured (either of which will seleect DM_BUFIO)?
> 
> Ah, right, this hasn't gone upstream yet; I had just pulled it in
> because I was seeing the problem with the umount hanging and killing
> my test runs.
> 
> Anyway, Eryu, I'd suggest you resend your patch with the following
> change, which seems to fix things up for me.
> 
> And with this patch included, feel free to add:
> 
> Reviewed-by: Theodore Ts'o <tytso@mit.edu>
> 
> 	      	       	   	     	 - Ted
> 
> diff --git a/tests/generic/299 b/tests/generic/299
> index e5de45b..9b99a66 100755
> --- a/tests/generic/299
> +++ b/tests/generic/299
> @@ -138,7 +138,7 @@ _workout()
>  	    done
>  	    # Following like will check that pid is still run.
>  	    # Once fio exit we can stop fallocate/truncate loop
> -	    pgrep fio > /dev/null 2>&1 || break
> +	    pgrep -f $XFS_IO_PROG > /dev/null 2>&1 || break

I assume you mean $FIO_PROG here :)

Yes, pgrep -f is doing the job and is much better than pgrep, thanks!

I didn't use $FIO_PROG at the first place because I was afraid that
$FIO_PROG contains some arguments like XFS_IO_PROG does (xfs_io -F).

But pgrep -f "$FIO_PROG" just works fine, I'll resend with this change.

Thanks!

Eryu

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

* [PATCH v4] generic/299: various fixes
  2014-12-12  4:43   ` [PATCH v3] " Eryu Guan
  2014-12-14 22:12     ` Theodore Ts'o
@ 2014-12-15  5:02     ` Eryu Guan
  1 sibling, 0 replies; 9+ messages in thread
From: Eryu Guan @ 2014-12-15  5:02 UTC (permalink / raw)
  To: fstests; +Cc: Eryu Guan

Fix two problems in generic/299

1. Remove $seqres.full before test, otherwise the file is growing all
the time.

2. Make sure fio really exits, otherwise fio would block umount. $pid is
the pid of function run_check not fio, sometimes fio is still there when
$pid is dead and blocking umount.

Reviewed-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eryu Guan <eguan@redhat.com>
---
v4:
- use pgrep -f instead of pgrep to search for fio (Ted)

v3:
- rebase and skip the replacing fallocate/truncate part (Dave)

v2:
- remove $seqres.full before _require_fio, which writes to $seqres.full too

 tests/generic/299 | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tests/generic/299 b/tests/generic/299
index e49eba9..953f1bd 100755
--- a/tests/generic/299
+++ b/tests/generic/299
@@ -109,6 +109,8 @@ rw=randrw
 filename=buffered-aio-verifier
 EOF
 
+rm -f $seqres.full
+
 _require_fio $fio_config
 _require_xfs_io_command "falloc"
 
@@ -136,7 +138,7 @@ _workout()
 	    done
 	    # Following like will check that pid is still run.
 	    # Once fio exit we can stop fallocate/truncate loop
-	    kill -0 $pid > /dev/null 2>&1 || break
+	    pgrep -f "$FIO_PROG" > /dev/null 2>&1 || break
 	done
 	wait $pid
 }
-- 
2.1.0


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

end of thread, other threads:[~2014-12-15  5:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-11 10:49 [PATCH] generic/299: various fixes Eryu Guan
2014-12-11 10:58 ` [PATCH v2] " Eryu Guan
2014-12-11 23:50   ` Dave Chinner
2014-12-12  2:51     ` Eryu Guan
2014-12-12  4:43   ` [PATCH v3] " Eryu Guan
2014-12-14 22:12     ` Theodore Ts'o
2014-12-14 22:17       ` Theodore Ts'o
2014-12-15  3:52         ` Eryu Guan
2014-12-15  5:02     ` [PATCH v4] " Eryu Guan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.