All of lore.kernel.org
 help / color / mirror / Atom feed
From: xuw2015@gmail.com
To: fstests@vger.kernel.org
Cc: George Wang <xuw2015@gmail.com>
Subject: [PATCH] xfs/015: make it more robust
Date: Sat,  4 Jul 2015 01:15:27 +0800	[thread overview]
Message-ID: <1435943727-6075-1-git-send-email-xuw2015@gmail.com> (raw)

From: George Wang <xuw2015@gmail.com>

create_file may run over before growfs, which depends on many reasons. such as
the schedule algorithm, the workload of testing machine, etc. we should always
make sure the create_file run over after growfs, then we can get the valid
result of this test.
---
 tests/xfs/015 | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/tests/xfs/015 b/tests/xfs/015
index 4dbf38a..d9d4446 100755
--- a/tests/xfs/015
+++ b/tests/xfs/015
@@ -43,9 +43,16 @@ create_file()
 {
 	local dir=$1
 	local i=0
-
-	while echo -n >$dir/testfile_$i; do
-		let i=$i+1
+	local in_growfs=false
+
+	# keep run until failed after growfs
+	while true; do
+		[ -f $tmp.growfs ] && in_growfs=true
+		while echo -n >$dir/testfile_$i; do
+			let i=$i+1
+		done
+		$in_growfs && break
+		usleep 1000
 	done
 }
 
@@ -89,6 +96,9 @@ echo "Fork $nr_worker workers to consume free inodes in background" >>$seqres.fu
 echo "Grow fs to $((dblocks * 4)) blocks" >>$seqres.full
 $XFS_GROWFS_PROG -D $((dblocks * 4)) $SCRATCH_MNT >>$seqres.full
 
+# mark xfs_growfs finished to create_file
+touch $tmp.growfs
+
 # Wait for background create_file to hit ENOSPC
 wait
 
-- 
1.8.4.2


             reply	other threads:[~2015-07-03 17:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-03 17:15 xuw2015 [this message]
2015-07-06  7:05 ` [PATCH] xfs/015: make it more robust Eryu Guan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435943727-6075-1-git-send-email-xuw2015@gmail.com \
    --to=xuw2015@gmail.com \
    --cc=fstests@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.