public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
From: Eryu Guan <eguan@redhat.com>
To: fstests@vger.kernel.org
Cc: Eryu Guan <eguan@redhat.com>
Subject: [PATCH] generic/204: do not call _scratch_mkfs_sized in a pipe
Date: Sun,  5 Nov 2017 16:11:10 +0800	[thread overview]
Message-ID: <20171105081110.26373-1-eguan@redhat.com> (raw)

_scratch_mkfs_sized will create a filesystem of the given size, and
call _notrun and exit if current $FSTYP doesn't support sized mkfs.
But when it's called in a pipe, the exit in _notrun only exits from
the subshell created by the pipe not the test itself, and test
continues to run unnecessarily.

Fix it by not calling _scratch_mkfs_sized in a pipe, but dumping the
output to a tmp file, which will be fed to _filter_mkfs later.

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

This is uncovered by Darrick's patch "generic/204: use available blocks
to determine the number of files to create", with this patch applied
test will 'hang' when testing on a large NFS export, because the number
of files to be created was based on the size of available space.

Note that I've dropped that patch because it also caused failure in 512B
block size XFS test.

 tests/generic/204 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/generic/204 b/tests/generic/204
index 4c203a213f5b..ebc9c0fa001b 100755
--- a/tests/generic/204
+++ b/tests/generic/204
@@ -58,8 +58,8 @@ _scratch_mkfs 2> /dev/null | _filter_mkfs 2> $tmp.mkfs > /dev/null
 [ $FSTYP = "xfs" ] && MKFS_OPTIONS="$MKFS_OPTIONS -l size=16m -i maxpct=50"
 
 SIZE=`expr 115 \* 1024 \* 1024`
-_scratch_mkfs_sized $SIZE $dbsize 2> /dev/null \
-		| _filter_mkfs 2> $tmp.mkfs > /dev/null
+_scratch_mkfs_sized $SIZE $dbsize 2> /dev/null > $tmp.mkfs.raw
+cat $tmp.mkfs.raw | _filter_mkfs 2> $tmp.mkfs > /dev/null
 _scratch_mount
 
 # Source $tmp.mkfs to get geometry
-- 
2.13.6


             reply	other threads:[~2017-11-05  8:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-05  8:11 Eryu Guan [this message]
2017-11-09  6:19 ` [PATCH] generic/204: do not call _scratch_mkfs_sized in a pipe Eryu Guan
2017-11-09 18:25 ` Darrick J. Wong
2017-11-10  3:17   ` 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=20171105081110.26373-1-eguan@redhat.com \
    --to=eguan@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox