public inbox for fstests@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic/102: Update strict check
@ 2017-01-05  8:56 Xiao Yang
  2017-01-05  9:38 ` Eryu Guan
  0 siblings, 1 reply; 4+ messages in thread
From: Xiao Yang @ 2017-01-05  8:56 UTC (permalink / raw)
  To: eguan; +Cc: fstests, Xiao Yang

Low memory may lead to "written less bytes than
requested".  We only care about if xfs_io returned
ENOSPC or not, so we can check stderr of xfs_io
instead of stdout.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 tests/generic/102     |  5 +++--
 tests/generic/102.out | 20 --------------------
 2 files changed, 3 insertions(+), 22 deletions(-)

diff --git a/tests/generic/102 b/tests/generic/102
index 3cdc2ba..104edc0 100755
--- a/tests/generic/102
+++ b/tests/generic/102
@@ -54,8 +54,9 @@ _scratch_mount
 for ((i = 0; i < 10; i++)); do
 	echo "loop $i" >>$seqres.full
 
-	$XFS_IO_PROG -f -c "pwrite -b 1m 0 400m" "$SCRATCH_MNT"/file | \
-_filter_xfs_io | _filter_scratch
+	out="$($XFS_IO_PROG -f -c "pwrite -b 1m 0 400m" "$SCRATCH_MNT"/file 2>&1)"
+	echo $out >>$seqres.full 2>&1
+	echo $out | grep -q "No space left on device" && echo "pwrite failed with ENOSPC"
 
 	rm -f "$SCRATCH_MNT"/file
 done
diff --git a/tests/generic/102.out b/tests/generic/102.out
index fc9275d..6fea359 100644
--- a/tests/generic/102.out
+++ b/tests/generic/102.out
@@ -1,21 +1 @@
 QA output created by 102
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-- 
1.8.3.1




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

* Re: [PATCH] generic/102: Update strict check
  2017-01-05  8:56 [PATCH] generic/102: Update strict check Xiao Yang
@ 2017-01-05  9:38 ` Eryu Guan
  2017-01-11  7:49   ` Xiao Yang
  2017-01-11  8:24   ` [PATCH v2] " Xiao Yang
  0 siblings, 2 replies; 4+ messages in thread
From: Eryu Guan @ 2017-01-05  9:38 UTC (permalink / raw)
  To: Xiao Yang; +Cc: fstests

On Thu, Jan 05, 2017 at 04:56:09PM +0800, Xiao Yang wrote:
> Low memory may lead to "written less bytes than
> requested".  We only care about if xfs_io returned
> ENOSPC or not, so we can check stderr of xfs_io
> instead of stdout.
> 
> Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>

I thought this was fine, but I'm not sure now. Because I recalled that
there was an ext4 bug in dax mount exposed by generic/102, and it was
the case that xfs_io returned less bytes than requested. See commit

e84dfbe ext4: retry block allocation for failed DIO and DAX writes

If we discard all the xfs_io stdout, we may miss such bugs in the
future. But I'd like to see more comments on this from filesystem
developers.

> ---
>  tests/generic/102     |  5 +++--
>  tests/generic/102.out | 20 --------------------
>  2 files changed, 3 insertions(+), 22 deletions(-)
> 
> diff --git a/tests/generic/102 b/tests/generic/102
> index 3cdc2ba..104edc0 100755
> --- a/tests/generic/102
> +++ b/tests/generic/102
> @@ -54,8 +54,9 @@ _scratch_mount
>  for ((i = 0; i < 10; i++)); do
>  	echo "loop $i" >>$seqres.full
>  
> -	$XFS_IO_PROG -f -c "pwrite -b 1m 0 400m" "$SCRATCH_MNT"/file | \
> -_filter_xfs_io | _filter_scratch
> +	out="$($XFS_IO_PROG -f -c "pwrite -b 1m 0 400m" "$SCRATCH_MNT"/file 2>&1)"
> +	echo $out >>$seqres.full 2>&1
> +	echo $out | grep -q "No space left on device" && echo "pwrite failed with ENOSPC"

If we want to discard xfs_io stdout, just redirect it to /dev/null,
ENOSPC error messgage will go to stderr and break the golden image
anyway.

Thanks,
Eryu

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

* Re: [PATCH] generic/102: Update strict check
  2017-01-05  9:38 ` Eryu Guan
@ 2017-01-11  7:49   ` Xiao Yang
  2017-01-11  8:24   ` [PATCH v2] " Xiao Yang
  1 sibling, 0 replies; 4+ messages in thread
From: Xiao Yang @ 2017-01-11  7:49 UTC (permalink / raw)
  To: Eryu Guan; +Cc: fstests

On 2017/01/05 17:38, Eryu Guan wrote:
> On Thu, Jan 05, 2017 at 04:56:09PM +0800, Xiao Yang wrote:
>> Low memory may lead to "written less bytes than
>> requested".  We only care about if xfs_io returned
>> ENOSPC or not, so we can check stderr of xfs_io
>> instead of stdout.
>>
>> Signed-off-by: Xiao Yang<yangx.jy@cn.fujitsu.com>
> I thought this was fine, but I'm not sure now. Because I recalled that
> there was an ext4 bug in dax mount exposed by generic/102, and it was
> the case that xfs_io returned less bytes than requested. See commit
>
> e84dfbe ext4: retry block allocation for failed DIO and DAX writes
>
> If we discard all the xfs_io stdout, we may miss such bugs in the
> future. But I'd like to see more comments on this from filesystem
> developers.
>
Hi Eryu

Yes,  I'd like to see more comments on this from filesystem developers too.
New case may be added to test the ext4 bug in dax mount and we only care
about if xfs_io returned ENOSPC or not in generic/102.   Do you think so?
>> ---
>>   tests/generic/102     |  5 +++--
>>   tests/generic/102.out | 20 --------------------
>>   2 files changed, 3 insertions(+), 22 deletions(-)
>>
>> diff --git a/tests/generic/102 b/tests/generic/102
>> index 3cdc2ba..104edc0 100755
>> --- a/tests/generic/102
>> +++ b/tests/generic/102
>> @@ -54,8 +54,9 @@ _scratch_mount
>>   for ((i = 0; i<  10; i++)); do
>>   	echo "loop $i">>$seqres.full
>>
>> -	$XFS_IO_PROG -f -c "pwrite -b 1m 0 400m" "$SCRATCH_MNT"/file | \
>> -_filter_xfs_io | _filter_scratch
>> +	out="$($XFS_IO_PROG -f -c "pwrite -b 1m 0 400m" "$SCRATCH_MNT"/file 2>&1)"
>> +	echo $out>>$seqres.full 2>&1
>> +	echo $out | grep -q "No space left on device"&&  echo "pwrite failed with ENOSPC"
> If we want to discard xfs_io stdout, just redirect it to /dev/null,
> ENOSPC error messgage will go to stderr and break the golden image
> anyway.
Agree it.  I will send v2 patch as you said.

Thanks,
Xiao Yang
> Thanks,
> Eryu
>
>
>




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

* [PATCH v2] generic/102: Update strict check
  2017-01-05  9:38 ` Eryu Guan
  2017-01-11  7:49   ` Xiao Yang
@ 2017-01-11  8:24   ` Xiao Yang
  1 sibling, 0 replies; 4+ messages in thread
From: Xiao Yang @ 2017-01-11  8:24 UTC (permalink / raw)
  To: eguan; +Cc: fstests, Xiao Yang

Low memory may lead to "written less bytes than requested".
We only care about if xfs_io returned ENOSPC or not, so we
can check stderr of xfs_io instead of stdout.

Signed-off-by: Xiao Yang <yangx.jy@cn.fujitsu.com>
---
 tests/generic/102     |  4 +---
 tests/generic/102.out | 20 --------------------
 2 files changed, 1 insertion(+), 23 deletions(-)

diff --git a/tests/generic/102 b/tests/generic/102
index 3cdc2ba..3ecf39e 100755
--- a/tests/generic/102
+++ b/tests/generic/102
@@ -54,9 +54,7 @@ _scratch_mount
 for ((i = 0; i < 10; i++)); do
 	echo "loop $i" >>$seqres.full
 
-	$XFS_IO_PROG -f -c "pwrite -b 1m 0 400m" "$SCRATCH_MNT"/file | \
-_filter_xfs_io | _filter_scratch
-
+	$XFS_IO_PROG -f -c "pwrite -b 1m 0 400m" "$SCRATCH_MNT"/file >/dev/null
 	rm -f "$SCRATCH_MNT"/file
 done
 
diff --git a/tests/generic/102.out b/tests/generic/102.out
index fc9275d..6fea359 100644
--- a/tests/generic/102.out
+++ b/tests/generic/102.out
@@ -1,21 +1 @@
 QA output created by 102
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-wrote 419430400/419430400 bytes at offset 0
-XXX Bytes, X ops; XX:XX:XX.X (XXX YYY/sec and XXX ops/sec)
-- 
1.8.3.1




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

end of thread, other threads:[~2017-01-11  8:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-05  8:56 [PATCH] generic/102: Update strict check Xiao Yang
2017-01-05  9:38 ` Eryu Guan
2017-01-11  7:49   ` Xiao Yang
2017-01-11  8:24   ` [PATCH v2] " Xiao Yang

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