diff mbox

[v2] generic/299: various fixes

Message ID 1418295529-20565-1-git-send-email-eguan@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eryu Guan Dec. 11, 2014, 10:58 a.m. UTC
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(-)

Comments

Dave Chinner Dec. 11, 2014, 11:50 p.m. UTC | #1
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.
Eryu Guan Dec. 12, 2014, 2:51 a.m. UTC | #2
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
--
To unsubscribe from this list: send the line "unsubscribe fstests" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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
 }