All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] generic: test i_blocks for large files
@ 2022-08-12 14:50 Pavel Reichl
  2022-08-13  5:44 ` Zorro Lang
  0 siblings, 1 reply; 9+ messages in thread
From: Pavel Reichl @ 2022-08-12 14:50 UTC (permalink / raw)
  To: fstests; +Cc: sj1557.seo

This is a regression test for an incorrect
computation of i_blocks for files larger than
4 GiB. Bug was filed for exFAT.

Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 tests/generic/693-inodes-for-large-files     | 49 ++++++++++++++++++++
 tests/generic/693-inodes-for-large-files.out |  1 +
 2 files changed, 50 insertions(+)
 create mode 100755 tests/generic/693-inodes-for-large-files
 create mode 100644 tests/generic/693-inodes-for-large-files.out

diff --git a/tests/generic/693-inodes-for-large-files b/tests/generic/693-inodes-for-large-files
new file mode 100755
index 00000000..797d6a21
--- /dev/null
+++ b/tests/generic/693-inodes-for-large-files
@@ -0,0 +1,49 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2022  Red Hat Inc. All Rights Reserved.
+#
+# FS QA Test 693
+#
+# Verify that i_blocks for files larger than 4 GiB have correct
+# values.
+#
+# This test verifies the problem fixed in kernel with commit
+# 0c336d6e33f4 exfat: fix incorrect loading of i_blocks for large files
+#
+. ./common/preamble
+_begin_fstest auto
+
+# Override the default cleanup function.
+_cleanup()
+{
+	cd /
+	rm -r -f $tmp.* $junk_dir
+}
+
+_supported_fs generic
+_require_test
+
+junk_dir=$TEST_DIR/$seq
+junk_file=$junk_dir/junk
+mkdir -p $junk_dir
+
+$XFS_IO_PROG -f -c "truncate 4G" $junk_file
+
+iblocks=`$XFS_IO_PROG -c "stat" $junk_file | grep 'stat.blocks'`
+test -z "$iblocks" && echo 'Failed to parse the blocks'
+
+_test_cycle_mount
+
+iblocks_after_remount=`$XFS_IO_PROG -c "stat" $junk_file | grep 'stat.blocks'`
+
+test -z "$iblocks_after_remount" && echo 'Failed to parse the blocks'
+
+if [ "$iblocks" != "$iblocks_after_remount" ]; then
+	echo "Number of blocks needs to be same: $iblocks, $iblocks_after_remount"
+	status=1
+	exit
+fi
+
+status=0
+
+exit
diff --git a/tests/generic/693-inodes-for-large-files.out b/tests/generic/693-inodes-for-large-files.out
new file mode 100644
index 00000000..f39aa77c
--- /dev/null
+++ b/tests/generic/693-inodes-for-large-files.out
@@ -0,0 +1 @@
+QA output created by 693-inodes-for-large-files
-- 
2.37.1


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

* Re: [PATCH] generic: test i_blocks for large files
  2022-08-12 14:50 [PATCH] generic: test i_blocks for large files Pavel Reichl
@ 2022-08-13  5:44 ` Zorro Lang
  2022-08-13  9:00   ` Pavel Reichl
  2022-08-16 10:45   ` [PATCH v2] " Pavel Reichl
  0 siblings, 2 replies; 9+ messages in thread
From: Zorro Lang @ 2022-08-13  5:44 UTC (permalink / raw)
  To: Pavel Reichl; +Cc: fstests, sj1557.seo

On Fri, Aug 12, 2022 at 04:50:50PM +0200, Pavel Reichl wrote:
> This is a regression test for an incorrect
> computation of i_blocks for files larger than
> 4 GiB. Bug was filed for exFAT.
> 
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---
>  tests/generic/693-inodes-for-large-files     | 49 ++++++++++++++++++++
>  tests/generic/693-inodes-for-large-files.out |  1 +
>  2 files changed, 50 insertions(+)
>  create mode 100755 tests/generic/693-inodes-for-large-files
>  create mode 100644 tests/generic/693-inodes-for-large-files.out
> 
> diff --git a/tests/generic/693-inodes-for-large-files b/tests/generic/693-inodes-for-large-files

I think case *number* is enough.

> new file mode 100755
> index 00000000..797d6a21
> --- /dev/null
> +++ b/tests/generic/693-inodes-for-large-files
> @@ -0,0 +1,49 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2022  Red Hat Inc. All Rights Reserved.
> +#
> +# FS QA Test 693
> +#
> +# Verify that i_blocks for files larger than 4 GiB have correct
> +# values.
> +#
> +# This test verifies the problem fixed in kernel with commit
> +# 0c336d6e33f4 exfat: fix incorrect loading of i_blocks for large files
> +#
> +. ./common/preamble
> +_begin_fstest auto
> +
> +# Override the default cleanup function.
> +_cleanup()
> +{
> +	cd /
> +	rm -r -f $tmp.* $junk_dir
> +}
> +
> +_supported_fs generic
> +_require_test

If this test need 4G free space, I'm wondering if we need to make sure
there's enough space in $TEST_DIR, as we do in _require_scratch_size.

> +
> +junk_dir=$TEST_DIR/$seq
> +junk_file=$junk_dir/junk
> +mkdir -p $junk_dir
> +
> +$XFS_IO_PROG -f -c "truncate 4G" $junk_file

It helps to allocate 4g real space on exfat, due to exfat doesn't
support sparse file, but on other filesystems (e.g. xfs, ext4, btrfs)
it will get a file which i_blocks=0.

As a generic test case, if you really want to allocate 4g real space,
I think you have to real write data:

  $XFS_IO_PROG -f -c "pwrite -W 0 4g" $junk_file

If anyone knows any better idea, feel free to reply :)

> +
> +iblocks=`$XFS_IO_PROG -c "stat" $junk_file | grep 'stat.blocks'`

stat -c %b $junk_file ??

> +test -z "$iblocks" && echo 'Failed to parse the blocks'
> +
> +_test_cycle_mount
> +
> +iblocks_after_remount=`$XFS_IO_PROG -c "stat" $junk_file | grep 'stat.blocks'`

stat -c %b $junk_file ??

> +
> +test -z "$iblocks_after_remount" && echo 'Failed to parse the blocks'

When will we get an empty "$iblocks_after_remount" ?

> +
> +if [ "$iblocks" != "$iblocks_after_remount" ]; then
> +	echo "Number of blocks needs to be same: $iblocks, $iblocks_after_remount"
> +	status=1

If you "exit" directly, the status is 1 by default. But I think you don't need
to exit at here, due to above output will break golden image and fail this test.

> +	exit
> +fi
> +
> +status=0
> +
> +exit
> diff --git a/tests/generic/693-inodes-for-large-files.out b/tests/generic/693-inodes-for-large-files.out
> new file mode 100644
> index 00000000..f39aa77c
> --- /dev/null
> +++ b/tests/generic/693-inodes-for-large-files.out
> @@ -0,0 +1 @@
> +QA output created by 693-inodes-for-large-files

Silence is golden ??

> -- 
> 2.37.1
> 


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

* Re: [PATCH] generic: test i_blocks for large files
  2022-08-13  5:44 ` Zorro Lang
@ 2022-08-13  9:00   ` Pavel Reichl
  2022-08-14  3:45     ` Zorro Lang
  2022-08-16 10:45   ` [PATCH v2] " Pavel Reichl
  1 sibling, 1 reply; 9+ messages in thread
From: Pavel Reichl @ 2022-08-13  9:00 UTC (permalink / raw)
  To: Zorro Lang; +Cc: fstests, sj1557.seo


On 8/13/22 07:44, Zorro Lang wrote:
> On Fri, Aug 12, 2022 at 04:50:50PM +0200, Pavel Reichl wrote:
>> This is a regression test for an incorrect
>> computation of i_blocks for files larger than
>> 4 GiB. Bug was filed for exFAT.
>>
>> Signed-off-by: Pavel Reichl <preichl@redhat.com>
>> ---
>>   tests/generic/693-inodes-for-large-files     | 49 ++++++++++++++++++++
>>   tests/generic/693-inodes-for-large-files.out |  1 +
>>   2 files changed, 50 insertions(+)
>>   create mode 100755 tests/generic/693-inodes-for-large-files
>>   create mode 100644 tests/generic/693-inodes-for-large-files.out
>>
>> diff --git a/tests/generic/693-inodes-for-large-files b/tests/generic/693-inodes-for-large-files
> I think case *number* is enough.
0K, the 'new' script asked, so I provided:-)
>
>> new file mode 100755
>> index 00000000..797d6a21
>> --- /dev/null
>> +++ b/tests/generic/693-inodes-for-large-files
>> @@ -0,0 +1,49 @@
>> +#! /bin/bash
>> +# SPDX-License-Identifier: GPL-2.0
>> +# Copyright (c) 2022  Red Hat Inc. All Rights Reserved.
>> +#
>> +# FS QA Test 693
>> +#
>> +# Verify that i_blocks for files larger than 4 GiB have correct
>> +# values.
>> +#
>> +# This test verifies the problem fixed in kernel with commit
>> +# 0c336d6e33f4 exfat: fix incorrect loading of i_blocks for large files
>> +#
>> +. ./common/preamble
>> +_begin_fstest auto
>> +
>> +# Override the default cleanup function.
>> +_cleanup()
>> +{
>> +	cd /
>> +	rm -r -f $tmp.* $junk_dir
>> +}
>> +
>> +_supported_fs generic
>> +_require_test
> If this test need 4G free space, I'm wondering if we need to make sure
> there's enough space in $TEST_DIR, as we do in _require_scratch_size.
OK, I'll look into it.
>
>> +
>> +junk_dir=$TEST_DIR/$seq
>> +junk_file=$junk_dir/junk
>> +mkdir -p $junk_dir
>> +
>> +$XFS_IO_PROG -f -c "truncate 4G" $junk_file
> It helps to allocate 4g real space on exfat, due to exfat doesn't
> support sparse file, but on other filesystems (e.g. xfs, ext4, btrfs)
> it will get a file which i_blocks=0.
OK, I know that and I think it's fine - I just need a test for 
consistency after remounting.
>
> As a generic test case, if you really want to allocate 4g real space,
> I think you have to real write data:
>
>    $XFS_IO_PROG -f -c "pwrite -W 0 4g" $junk_file
>
> If anyone knows any better idea, feel free to reply :)
>
>> +
>> +iblocks=`$XFS_IO_PROG -c "stat" $junk_file | grep 'stat.blocks'`
> stat -c %b $junk_file ??
>
>> +test -z "$iblocks" && echo 'Failed to parse the blocks'
>> +
>> +_test_cycle_mount
>> +
>> +iblocks_after_remount=`$XFS_IO_PROG -c "stat" $junk_file | grep 'stat.blocks'`
> stat -c %b $junk_file ??
>
>> +
>> +test -z "$iblocks_after_remount" && echo 'Failed to parse the blocks'
> When will we get an empty "$iblocks_after_remount" ?
It is just a check that both xfs_io and grep worked as expected.
>
>> +
>> +if [ "$iblocks" != "$iblocks_after_remount" ]; then
>> +	echo "Number of blocks needs to be same: $iblocks, $iblocks_after_remount"
>> +	status=1
> If you "exit" directly, the status is 1 by default. But I think you don't need
> to exit at here, due to above output will break golden image and fail this test.
OK, I'll fix that. Thanks!
>
>> +	exit
>> +fi
>> +
>> +status=0
>> +
>> +exit
>> diff --git a/tests/generic/693-inodes-for-large-files.out b/tests/generic/693-inodes-for-large-files.out
>> new file mode 100644
>> index 00000000..f39aa77c
>> --- /dev/null
>> +++ b/tests/generic/693-inodes-for-large-files.out
>> @@ -0,0 +1 @@
>> +QA output created by 693-inodes-for-large-files
> Silence is golden ??

Well I don't echo that in the script, but if that's custom I'll do it.


Thanks for the comments!

>
>> -- 
>> 2.37.1
>>


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

* Re: [PATCH] generic: test i_blocks for large files
  2022-08-13  9:00   ` Pavel Reichl
@ 2022-08-14  3:45     ` Zorro Lang
  0 siblings, 0 replies; 9+ messages in thread
From: Zorro Lang @ 2022-08-14  3:45 UTC (permalink / raw)
  To: Pavel Reichl; +Cc: fstests, sj1557.seo

On Sat, Aug 13, 2022 at 11:00:54AM +0200, Pavel Reichl wrote:
> 
> On 8/13/22 07:44, Zorro Lang wrote:
> > On Fri, Aug 12, 2022 at 04:50:50PM +0200, Pavel Reichl wrote:
> > > This is a regression test for an incorrect
> > > computation of i_blocks for files larger than
> > > 4 GiB. Bug was filed for exFAT.
> > > 
> > > Signed-off-by: Pavel Reichl <preichl@redhat.com>
> > > ---
> > >   tests/generic/693-inodes-for-large-files     | 49 ++++++++++++++++++++
> > >   tests/generic/693-inodes-for-large-files.out |  1 +
> > >   2 files changed, 50 insertions(+)
> > >   create mode 100755 tests/generic/693-inodes-for-large-files
> > >   create mode 100644 tests/generic/693-inodes-for-large-files.out
> > > 
> > > diff --git a/tests/generic/693-inodes-for-large-files b/tests/generic/693-inodes-for-large-files
> > I think case *number* is enough.
> 0K, the 'new' script asked, so I provided:-)
> > 
> > > new file mode 100755
> > > index 00000000..797d6a21
> > > --- /dev/null
> > > +++ b/tests/generic/693-inodes-for-large-files
> > > @@ -0,0 +1,49 @@
> > > +#! /bin/bash
> > > +# SPDX-License-Identifier: GPL-2.0
> > > +# Copyright (c) 2022  Red Hat Inc. All Rights Reserved.
> > > +#
> > > +# FS QA Test 693
> > > +#
> > > +# Verify that i_blocks for files larger than 4 GiB have correct
> > > +# values.
> > > +#
> > > +# This test verifies the problem fixed in kernel with commit
> > > +# 0c336d6e33f4 exfat: fix incorrect loading of i_blocks for large files
> > > +#
> > > +. ./common/preamble
> > > +_begin_fstest auto
> > > +
> > > +# Override the default cleanup function.
> > > +_cleanup()
> > > +{
> > > +	cd /
> > > +	rm -r -f $tmp.* $junk_dir
> > > +}
> > > +
> > > +_supported_fs generic
> > > +_require_test
> > If this test need 4G free space, I'm wondering if we need to make sure
> > there's enough space in $TEST_DIR, as we do in _require_scratch_size.
> OK, I'll look into it.
> > 
> > > +
> > > +junk_dir=$TEST_DIR/$seq
> > > +junk_file=$junk_dir/junk
> > > +mkdir -p $junk_dir
> > > +
> > > +$XFS_IO_PROG -f -c "truncate 4G" $junk_file
> > It helps to allocate 4g real space on exfat, due to exfat doesn't
> > support sparse file, but on other filesystems (e.g. xfs, ext4, btrfs)
> > it will get a file which i_blocks=0.
> OK, I know that and I think it's fine - I just need a test for consistency
> after remounting.

So you don't need to allocate 4g real space? If so, that helps the test faster,
but that depends on what are you really trying to test. I just saw you try to
get 4g i_blocks, so thought you might need 4g real space.

Thanks,
Zorro

> > 
> > As a generic test case, if you really want to allocate 4g real space,
> > I think you have to real write data:
> > 
> >    $XFS_IO_PROG -f -c "pwrite -W 0 4g" $junk_file
> > 
> > If anyone knows any better idea, feel free to reply :)
> > 
> > > +
> > > +iblocks=`$XFS_IO_PROG -c "stat" $junk_file | grep 'stat.blocks'`
> > stat -c %b $junk_file ??
> > 
> > > +test -z "$iblocks" && echo 'Failed to parse the blocks'
> > > +
> > > +_test_cycle_mount
> > > +
> > > +iblocks_after_remount=`$XFS_IO_PROG -c "stat" $junk_file | grep 'stat.blocks'`
> > stat -c %b $junk_file ??
> > 
> > > +
> > > +test -z "$iblocks_after_remount" && echo 'Failed to parse the blocks'
> > When will we get an empty "$iblocks_after_remount" ?
> It is just a check that both xfs_io and grep worked as expected.
> > 
> > > +
> > > +if [ "$iblocks" != "$iblocks_after_remount" ]; then
> > > +	echo "Number of blocks needs to be same: $iblocks, $iblocks_after_remount"
> > > +	status=1
> > If you "exit" directly, the status is 1 by default. But I think you don't need
> > to exit at here, due to above output will break golden image and fail this test.
> OK, I'll fix that. Thanks!
> > 
> > > +	exit
> > > +fi
> > > +
> > > +status=0
> > > +
> > > +exit
> > > diff --git a/tests/generic/693-inodes-for-large-files.out b/tests/generic/693-inodes-for-large-files.out
> > > new file mode 100644
> > > index 00000000..f39aa77c
> > > --- /dev/null
> > > +++ b/tests/generic/693-inodes-for-large-files.out
> > > @@ -0,0 +1 @@
> > > +QA output created by 693-inodes-for-large-files
> > Silence is golden ??
> 
> Well I don't echo that in the script, but if that's custom I'll do it.
> 
> 
> Thanks for the comments!
> 
> > 
> > > -- 
> > > 2.37.1
> > > 
> 


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

* [PATCH v2] generic: test i_blocks for large files
  2022-08-13  5:44 ` Zorro Lang
  2022-08-13  9:00   ` Pavel Reichl
@ 2022-08-16 10:45   ` Pavel Reichl
  2022-08-16 15:58     ` Darrick J. Wong
  1 sibling, 1 reply; 9+ messages in thread
From: Pavel Reichl @ 2022-08-16 10:45 UTC (permalink / raw)
  To: fstests

This is a regression test for an incorrect
computation of i_blocks for files larger than
4 GiB. Bug was filed for exFAT.

Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 common/rc             | 10 ++++++++++
 tests/generic/693     | 46 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/693.out |  2 ++
 3 files changed, 58 insertions(+)
 create mode 100755 tests/generic/693
 create mode 100644 tests/generic/693.out

diff --git a/common/rc b/common/rc
index 197c9415..06cbdee5 100644
--- a/common/rc
+++ b/common/rc
@@ -1980,6 +1980,16 @@ _require_test()
     touch ${RESULT_DIR}/require_test
 }
 
+# require a test dev of a minimum size (in kb)
+_require_test_size()
+{
+	[ $# -eq 1 ] || _fail "_require_test_size: expected size param"
+
+	_require_test
+	local devsize=`_get_device_size $TEST_DEV`
+	[ $devsize -lt $1 ] && _notrun "test dev too small"
+}
+
 _has_logdev()
 {
 	local ret=0
diff --git a/tests/generic/693 b/tests/generic/693
new file mode 100755
index 00000000..a6d1abff
--- /dev/null
+++ b/tests/generic/693
@@ -0,0 +1,46 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2022  Red Hat Inc. All Rights Reserved.
+#
+# FS QA Test 693
+#
+# Verify that i_blocks for files larger than 4 GiB have correct
+# values.
+#
+# This test verifies the problem fixed in kernel with commit
+# 0c336d6e33f4 exfat: fix incorrect loading of i_blocks for large files
+#
+. ./common/preamble
+_begin_fstest auto
+
+# Override the default cleanup function.
+_cleanup()
+{
+	cd /
+	rm -r -f $tmp.* $junk_dir
+}
+
+_supported_fs generic
+_require_test_size $((4 * 1024 * 1024)) #kB
+
+echo "Silence is golden"
+
+junk_dir=$TEST_DIR/$seq
+junk_file=$junk_dir/junk
+mkdir -p $junk_dir
+
+$XFS_IO_PROG -f -c "pwrite -W 0 4G" $junk_file > /dev/null
+
+iblocks=`stat -c '%b' $junk_file`
+
+_test_cycle_mount
+
+iblocks_after_remount=`stat -c '%b' $junk_file`
+
+if [ "$iblocks" != "$iblocks_after_remount" ]; then
+	echo "Number of blocks needs to be same: $iblocks, $iblocks_after_remount"
+fi
+
+status=0
+
+exit
diff --git a/tests/generic/693.out b/tests/generic/693.out
new file mode 100644
index 00000000..01884ea5
--- /dev/null
+++ b/tests/generic/693.out
@@ -0,0 +1,2 @@
+QA output created by 693
+Silence is golden
-- 
2.37.2


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

* Re: [PATCH v2] generic: test i_blocks for large files
  2022-08-16 10:45   ` [PATCH v2] " Pavel Reichl
@ 2022-08-16 15:58     ` Darrick J. Wong
  2022-08-16 16:08       ` Pavel Reichl
  2022-08-18 11:39       ` [PATCH v3] " Pavel Reichl
  0 siblings, 2 replies; 9+ messages in thread
From: Darrick J. Wong @ 2022-08-16 15:58 UTC (permalink / raw)
  To: Pavel Reichl; +Cc: fstests

On Tue, Aug 16, 2022 at 12:45:36PM +0200, Pavel Reichl wrote:
> This is a regression test for an incorrect
> computation of i_blocks for files larger than
> 4 GiB. Bug was filed for exFAT.
> 
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---
>  common/rc             | 10 ++++++++++
>  tests/generic/693     | 46 +++++++++++++++++++++++++++++++++++++++++++
>  tests/generic/693.out |  2 ++
>  3 files changed, 58 insertions(+)
>  create mode 100755 tests/generic/693
>  create mode 100644 tests/generic/693.out
> 
> diff --git a/common/rc b/common/rc
> index 197c9415..06cbdee5 100644
> --- a/common/rc
> +++ b/common/rc
> @@ -1980,6 +1980,16 @@ _require_test()
>      touch ${RESULT_DIR}/require_test
>  }
>  
> +# require a test dev of a minimum size (in kb)
> +_require_test_size()
> +{
> +	[ $# -eq 1 ] || _fail "_require_test_size: expected size param"
> +
> +	_require_test
> +	local devsize=`_get_device_size $TEST_DEV`
> +	[ $devsize -lt $1 ] && _notrun "test dev too small"
> +}
> +
>  _has_logdev()
>  {
>  	local ret=0
> diff --git a/tests/generic/693 b/tests/generic/693
> new file mode 100755
> index 00000000..a6d1abff
> --- /dev/null
> +++ b/tests/generic/693
> @@ -0,0 +1,46 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2022  Red Hat Inc. All Rights Reserved.
> +#
> +# FS QA Test 693
> +#
> +# Verify that i_blocks for files larger than 4 GiB have correct
> +# values.
> +#
> +# This test verifies the problem fixed in kernel with commit
> +# 0c336d6e33f4 exfat: fix incorrect loading of i_blocks for large files
> +#
> +. ./common/preamble
> +_begin_fstest auto
> +
> +# Override the default cleanup function.
> +_cleanup()
> +{
> +	cd /
> +	rm -r -f $tmp.* $junk_dir
> +}
> +
> +_supported_fs generic
> +_require_test_size $((4 * 1024 * 1024)) #kB

What does this new helper do that "_require_fs_space $TEST_DIR 4194304"
wouldn't solve?

--D

> +
> +echo "Silence is golden"
> +
> +junk_dir=$TEST_DIR/$seq
> +junk_file=$junk_dir/junk
> +mkdir -p $junk_dir
> +
> +$XFS_IO_PROG -f -c "pwrite -W 0 4G" $junk_file > /dev/null
> +
> +iblocks=`stat -c '%b' $junk_file`
> +
> +_test_cycle_mount
> +
> +iblocks_after_remount=`stat -c '%b' $junk_file`
> +
> +if [ "$iblocks" != "$iblocks_after_remount" ]; then
> +	echo "Number of blocks needs to be same: $iblocks, $iblocks_after_remount"
> +fi
> +
> +status=0
> +
> +exit
> diff --git a/tests/generic/693.out b/tests/generic/693.out
> new file mode 100644
> index 00000000..01884ea5
> --- /dev/null
> +++ b/tests/generic/693.out
> @@ -0,0 +1,2 @@
> +QA output created by 693
> +Silence is golden
> -- 
> 2.37.2
> 

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

* Re: [PATCH v2] generic: test i_blocks for large files
  2022-08-16 15:58     ` Darrick J. Wong
@ 2022-08-16 16:08       ` Pavel Reichl
  2022-08-18 11:39       ` [PATCH v3] " Pavel Reichl
  1 sibling, 0 replies; 9+ messages in thread
From: Pavel Reichl @ 2022-08-16 16:08 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: fstests


On 8/16/22 17:58, Darrick J. Wong wrote:
> On Tue, Aug 16, 2022 at 12:45:36PM +0200, Pavel Reichl wrote:
>> This is a regression test for an incorrect
>> computation of i_blocks for files larger than
>> 4 GiB. Bug was filed for exFAT.
>>
>> Signed-off-by: Pavel Reichl <preichl@redhat.com>
>> ---
>>   common/rc             | 10 ++++++++++
>>   tests/generic/693     | 46 +++++++++++++++++++++++++++++++++++++++++++
>>   tests/generic/693.out |  2 ++
>>   3 files changed, 58 insertions(+)
>>   create mode 100755 tests/generic/693
>>   create mode 100644 tests/generic/693.out
>>
>> diff --git a/common/rc b/common/rc
>> index 197c9415..06cbdee5 100644
>> --- a/common/rc
>> +++ b/common/rc
>> @@ -1980,6 +1980,16 @@ _require_test()
>>       touch ${RESULT_DIR}/require_test
>>   }
>>   
>> +# require a test dev of a minimum size (in kb)
>> +_require_test_size()
>> +{
>> +	[ $# -eq 1 ] || _fail "_require_test_size: expected size param"
>> +
>> +	_require_test
>> +	local devsize=`_get_device_size $TEST_DEV`
>> +	[ $devsize -lt $1 ] && _notrun "test dev too small"
>> +}
>> +
>>   _has_logdev()
>>   {
>>   	local ret=0
>> diff --git a/tests/generic/693 b/tests/generic/693
>> new file mode 100755
>> index 00000000..a6d1abff
>> --- /dev/null
>> +++ b/tests/generic/693
>> @@ -0,0 +1,46 @@
>> +#! /bin/bash
>> +# SPDX-License-Identifier: GPL-2.0
>> +# Copyright (c) 2022  Red Hat Inc. All Rights Reserved.
>> +#
>> +# FS QA Test 693
>> +#
>> +# Verify that i_blocks for files larger than 4 GiB have correct
>> +# values.
>> +#
>> +# This test verifies the problem fixed in kernel with commit
>> +# 0c336d6e33f4 exfat: fix incorrect loading of i_blocks for large files
>> +#
>> +. ./common/preamble
>> +_begin_fstest auto
>> +
>> +# Override the default cleanup function.
>> +_cleanup()
>> +{
>> +	cd /
>> +	rm -r -f $tmp.* $junk_dir
>> +}
>> +
>> +_supported_fs generic
>> +_require_test_size $((4 * 1024 * 1024)) #kB
> What does this new helper do that "_require_fs_space $TEST_DIR 4194304"
> wouldn't solve?

Hello,

nothing  - I was not aware of that. I'll change it to use 
'_require_fs_space'

Thanks!

> --D
>
>> +
>> +echo "Silence is golden"
>> +
>> +junk_dir=$TEST_DIR/$seq
>> +junk_file=$junk_dir/junk
>> +mkdir -p $junk_dir
>> +
>> +$XFS_IO_PROG -f -c "pwrite -W 0 4G" $junk_file > /dev/null
>> +
>> +iblocks=`stat -c '%b' $junk_file`
>> +
>> +_test_cycle_mount
>> +
>> +iblocks_after_remount=`stat -c '%b' $junk_file`
>> +
>> +if [ "$iblocks" != "$iblocks_after_remount" ]; then
>> +	echo "Number of blocks needs to be same: $iblocks, $iblocks_after_remount"
>> +fi
>> +
>> +status=0
>> +
>> +exit
>> diff --git a/tests/generic/693.out b/tests/generic/693.out
>> new file mode 100644
>> index 00000000..01884ea5
>> --- /dev/null
>> +++ b/tests/generic/693.out
>> @@ -0,0 +1,2 @@
>> +QA output created by 693
>> +Silence is golden
>> -- 
>> 2.37.2
>>


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

* [PATCH v3] generic: test i_blocks for large files
  2022-08-16 15:58     ` Darrick J. Wong
  2022-08-16 16:08       ` Pavel Reichl
@ 2022-08-18 11:39       ` Pavel Reichl
  2022-08-19 14:02         ` Zorro Lang
  1 sibling, 1 reply; 9+ messages in thread
From: Pavel Reichl @ 2022-08-18 11:39 UTC (permalink / raw)
  To: fstests

This is a regression test for an incorrect
computation of i_blocks for files larger than
4 GiB. Bug was filed for exFAT.

Signed-off-by: Pavel Reichl <preichl@redhat.com>
---
 tests/generic/693     | 47 +++++++++++++++++++++++++++++++++++++++++++
 tests/generic/693.out |  2 ++
 2 files changed, 49 insertions(+)
 create mode 100755 tests/generic/693
 create mode 100644 tests/generic/693.out

diff --git a/tests/generic/693 b/tests/generic/693
new file mode 100755
index 00000000..29992ed0
--- /dev/null
+++ b/tests/generic/693
@@ -0,0 +1,47 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2022  Red Hat Inc. All Rights Reserved.
+#
+# FS QA Test 693
+#
+# Verify that i_blocks for files larger than 4 GiB have correct
+# values.
+#
+# This test verifies the problem fixed in kernel with commit
+# 0c336d6e33f4 exfat: fix incorrect loading of i_blocks for large files
+#
+. ./common/preamble
+_begin_fstest auto
+
+# Override the default cleanup function.
+_cleanup()
+{
+	cd /
+	rm -r -f $tmp.* $junk_dir
+}
+
+_supported_fs generic
+_require_test
+_require_fs_space $TEST_DIR $((4 * 1024 * 1024)) #kB
+
+echo "Silence is golden"
+
+junk_dir=$TEST_DIR/$seq
+junk_file=$junk_dir/junk
+mkdir -p $junk_dir
+
+$XFS_IO_PROG -f -c "pwrite -W 0 4G" $junk_file > /dev/null
+
+iblocks=`stat -c '%b' $junk_file`
+
+_test_cycle_mount
+
+iblocks_after_remount=`stat -c '%b' $junk_file`
+
+if [ "$iblocks" != "$iblocks_after_remount" ]; then
+	echo "Number of blocks needs to be same: $iblocks, $iblocks_after_remount"
+fi
+
+status=0
+
+exit
diff --git a/tests/generic/693.out b/tests/generic/693.out
new file mode 100644
index 00000000..01884ea5
--- /dev/null
+++ b/tests/generic/693.out
@@ -0,0 +1,2 @@
+QA output created by 693
+Silence is golden
-- 
2.37.2


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

* Re: [PATCH v3] generic: test i_blocks for large files
  2022-08-18 11:39       ` [PATCH v3] " Pavel Reichl
@ 2022-08-19 14:02         ` Zorro Lang
  0 siblings, 0 replies; 9+ messages in thread
From: Zorro Lang @ 2022-08-19 14:02 UTC (permalink / raw)
  To: Pavel Reichl; +Cc: fstests

On Thu, Aug 18, 2022 at 01:39:05PM +0200, Pavel Reichl wrote:
> This is a regression test for an incorrect
> computation of i_blocks for files larger than
> 4 GiB. Bug was filed for exFAT.
> 
> Signed-off-by: Pavel Reichl <preichl@redhat.com>
> ---

This version looks good to me, just a tiny problem, generic/693 has been taken
by current upstream xfstests for-next branch, would you mind rebasing this
patch to latest xfstests?

Anyway you can have:
Reviewed-by: Zorro Lang <zlang@redhat.com>

>  tests/generic/693     | 47 +++++++++++++++++++++++++++++++++++++++++++
>  tests/generic/693.out |  2 ++
>  2 files changed, 49 insertions(+)
>  create mode 100755 tests/generic/693
>  create mode 100644 tests/generic/693.out
> 
> diff --git a/tests/generic/693 b/tests/generic/693
> new file mode 100755
> index 00000000..29992ed0
> --- /dev/null
> +++ b/tests/generic/693
> @@ -0,0 +1,47 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2022  Red Hat Inc. All Rights Reserved.
> +#
> +# FS QA Test 693
> +#
> +# Verify that i_blocks for files larger than 4 GiB have correct
> +# values.
> +#
> +# This test verifies the problem fixed in kernel with commit
> +# 0c336d6e33f4 exfat: fix incorrect loading of i_blocks for large files
> +#
> +. ./common/preamble
> +_begin_fstest auto
> +
> +# Override the default cleanup function.
> +_cleanup()
> +{
> +	cd /
> +	rm -r -f $tmp.* $junk_dir
> +}
> +
> +_supported_fs generic
> +_require_test
> +_require_fs_space $TEST_DIR $((4 * 1024 * 1024)) #kB
> +
> +echo "Silence is golden"
> +
> +junk_dir=$TEST_DIR/$seq
> +junk_file=$junk_dir/junk
> +mkdir -p $junk_dir
> +
> +$XFS_IO_PROG -f -c "pwrite -W 0 4G" $junk_file > /dev/null
> +
> +iblocks=`stat -c '%b' $junk_file`
> +
> +_test_cycle_mount
> +
> +iblocks_after_remount=`stat -c '%b' $junk_file`
> +
> +if [ "$iblocks" != "$iblocks_after_remount" ]; then
> +	echo "Number of blocks needs to be same: $iblocks, $iblocks_after_remount"
> +fi
> +
> +status=0
> +
> +exit
> diff --git a/tests/generic/693.out b/tests/generic/693.out
> new file mode 100644
> index 00000000..01884ea5
> --- /dev/null
> +++ b/tests/generic/693.out
> @@ -0,0 +1,2 @@
> +QA output created by 693
> +Silence is golden
> -- 
> 2.37.2
> 


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

end of thread, other threads:[~2022-08-19 14:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-12 14:50 [PATCH] generic: test i_blocks for large files Pavel Reichl
2022-08-13  5:44 ` Zorro Lang
2022-08-13  9:00   ` Pavel Reichl
2022-08-14  3:45     ` Zorro Lang
2022-08-16 10:45   ` [PATCH v2] " Pavel Reichl
2022-08-16 15:58     ` Darrick J. Wong
2022-08-16 16:08       ` Pavel Reichl
2022-08-18 11:39       ` [PATCH v3] " Pavel Reichl
2022-08-19 14:02         ` Zorro Lang

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.