Skip to contentSkip to conversation

Random fixes for xfstest

PATCH In review Anju T Sudhakar 6 participants 12 messages Oct 11, 2021 – Oct 12, 2021

lore
Share & tools
lore
#0 lore raw

cover Random fixes for xfstest

Below are some fixes for xfstest- mostly centered around 64k blocksize(ppc64) and with xfs filesystem.

Anju T Sudhakar (4):
xfs/432: Skip this test for dax config and pagesize not equal to the
specified block size
generic/594: Fix test failure for xfs on older quota-tools generic/600: Fix this test on xfs with older quota-tools generic/219: Fix test failure on 64k block size

 tests/generic/219 | 5 +++++
 tests/generic/594 | 6 ++++++
 tests/generic/600 | 8 ++++++++
 tests/xfs/432     | 4 ++++
 4 files changed, 23 insertions(+)
Signature · 1 line
2.24.1
#1 lore raw

PATCH 1/4 xfs/432: Skip this test for dax config and pagesize not equal to the specified block size

This test case passes 1k as the block size(to keep that as minimum), and hence it fails to mount with "-o dax" option on platforms where pageszie not equal to the specified block size. This leads to test case reported as "failed" with dax config.

So skip this test when dax is enabled.

---
 tests/xfs/432 | 4 ++++
 1 file changed, 4 insertions(+)
tests/xfs/432 +4 -0
index 40cb2474..9022af69 100755
@@ -32,6 +32,10 @@ _require_scratch
 
 rm -f "$seqres.full"
 
+# Skip this test, if pagesize !=1k and dax is enabled.
+if [[ $(get_page_size) -ne 1024 ]]; then
+	_exclude_scratch_mount_option dax
+fi
 echo "Format and mount"
 # We need to create a directory with a huuuge extent record.  Normally
 # a rapidly expanding directory gets its blocks allocated in lockstep --
Signature · 1 line
2.24.1
#2 lore raw

Re: [PATCH 1/4] xfs/432: Skip this test for dax config and pagesize not equal to the specified block size

Quoted 17 lines · Anju T Sudhakar

This test case passes 1k as the block size(to keep that as minimum), and hence it fails to mount with "-o dax" option on platforms where pageszie not equal to the specified block size. This leads to test case reported as "failed" with dax config.

So skip this test when dax is enabled.

---
 tests/xfs/432 | 4 ++++
 1 file changed, 4 insertions(+)
tests/xfs/432 +0 -0
index 40cb2474..9022af69 100755

tests/xfs/432 _require_scratch · line 38

Quoted 7 lines
tests/xfs/432 +4 -0
@@ -32,6 +32,10 @@ _require_scratch
 
 rm -f "$seqres.full"
 
+# Skip this test, if pagesize !=1k and dax is enabled.
+if [[ $(get_page_size) -ne 1024 ]]; then
+	_exclude_scratch_mount_option dax
+fi

Page size will never be 1kB so there's no point even checking the page size here.

The problem here is that exclusing the dax mount option is completely wrong when "-o dax=never" is used - it means that even though the storage hardware is DAX capable, don't use dax at all, and so tests that use 1kB block sizes will actaully work.

IOWs, this test should run if dax=never or dax=inode is set, but not if dax=always or just plain "dax" is set...

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#3 lore raw

PATCH 2/4 generic/594: Fix test failure for xfs on older quota-tools

In reply to Anju T Sudhakar

For xfs we need the quota-tools containing commit fdd774bf08e568 ("quota-tools: pass quota type to QCMD for Q_XFS_GETQSTAT")to run this test. Otherwise this test will fail on xfs, as the grace time is not set correctly. So check for the quota-tool with the required commit before running this test on xfs.

---
 tests/generic/594 | 6 ++++++
 1 file changed, 6 insertions(+)
tests/generic/594 +6 -0
index 88f9a0dc..668c1fae 100755
@@ -6,6 +6,8 @@
 #
 # Test per-type(user, group and project) filesystem quota timers, make sure
 # each of grace time can be set/get properly.
+# For xfs, you need a quota-tools containing commit fdd774bf08e568 for this
+# test to run properly- v4.06 should do.
 #
 . ./common/preamble
 _begin_fstest auto quick quota
@@ -18,9 +20,13 @@ _begin_fstest auto quick quota
 _supported_fs generic
 _require_scratch
 _require_setquota_project
+version=$(setquota -V | head -n1 | cut -d" " -f4)
 # V4 XFS doesn't support to mount project and group quota together
 if [ "$FSTYP" = "xfs" ];then
 	_require_scratch_xfs_crc
+	if [ "$version" \< "4.06" ];then
+		_notrun "This test requires quota-tools 4.06 or greater"
+	fi
 fi
 _require_quota
 
Signature · 1 line
2.24.1
#4 lore raw

Re: [PATCH 2/4] generic/594: Fix test failure for xfs on older quota-tools

Quoted 25 lines · Anju T Sudhakar

For xfs we need the quota-tools containing commit fdd774bf08e568 ("quota-tools: pass quota type to QCMD for Q_XFS_GETQSTAT")to run this test. Otherwise this test will fail on xfs, as the grace time is not set correctly. So check for the quota-tool with the required commit before running this test on xfs.

---
 tests/generic/594 | 6 ++++++
 1 file changed, 6 insertions(+)
tests/generic/594 +2 -0
index 88f9a0dc..668c1fae 100755
@@ -6,6 +6,8 @@
 #
 # Test per-type(user, group and project) filesystem quota timers, make sure
 # each of grace time can be set/get properly.
+# For xfs, you need a quota-tools containing commit fdd774bf08e568 for this
+# test to run properly- v4.06 should do.
 #
 . ./common/preamble
 _begin_fstest auto quick quota

tests/generic/594 _begin_fstest auto quick quota · line 29

Quoted 10 lines
tests/generic/594 +4 -0
@@ -18,9 +20,13 @@ _begin_fstest auto quick quota
 _supported_fs generic
 _require_scratch
 _require_setquota_project
+version=$(setquota -V | head -n1 | cut -d" " -f4)
 # V4 XFS doesn't support to mount project and group quota together
 if [ "$FSTYP" = "xfs" ];then
 	_require_scratch_xfs_crc
+	if [ "$version" \< "4.06" ];then
+		_notrun "This test requires quota-tools 4.06 or greater"
+	fi

We don't test for version numbers, because feature and bug fix back ports make testing version numbers unreliable. What needs to be done here is to test whether the feature is available of not via a _require_setquota_xfs_getqstat() rule that encapsulates the feature test and _notrun call if the feature is not supported.

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#5 lore raw

Re: [PATCH 2/4] generic/594: Fix test failure for xfs on older quota-tools

In reply to Anju T Sudhakar
Quoted 5 lines · Anju T Sudhakar

For xfs we need the quota-tools containing commit fdd774bf08e568 ("quota-tools: pass quota type to QCMD for Q_XFS_GETQSTAT")to run this test. Otherwise this test will fail on xfs, as the grace time is not set correctly. So check for the quota-tool with the required commit before running this test on xfs.

This is a regression test for a kernel bug where Q_XGETQSTAT[V] ignores the quota type that userspace specifies in the system call and instead returns information about the first enabled quotatype. It just so happens that quota-tools /also/ had a bug where it would never send the user's quota type to the kernel, so nobody noticed the nested herp and derp.

The test should probably have mentioned kernel commit 555b2c3da1fc ("quota: honor quota type in Q_XGETQSTAT[V] calls") directly to make this more obvious.

--D

Quoted 35 lines
---
 tests/generic/594 | 6 ++++++
 1 file changed, 6 insertions(+)
tests/generic/594 +6 -0
index 88f9a0dc..668c1fae 100755
@@ -6,6 +6,8 @@
 #
 # Test per-type(user, group and project) filesystem quota timers, make sure
 # each of grace time can be set/get properly.
+# For xfs, you need a quota-tools containing commit fdd774bf08e568 for this
+# test to run properly- v4.06 should do.
 #
 . ./common/preamble
 _begin_fstest auto quick quota
@@ -18,9 +20,13 @@ _begin_fstest auto quick quota
 _supported_fs generic
 _require_scratch
 _require_setquota_project
+version=$(setquota -V | head -n1 | cut -d" " -f4)
 # V4 XFS doesn't support to mount project and group quota together
 if [ "$FSTYP" = "xfs" ];then
 	_require_scratch_xfs_crc
+	if [ "$version" \< "4.06" ];then
+		_notrun "This test requires quota-tools 4.06 or greater"
+	fi
 fi
 _require_quota
 
Signature · 1 line
2.24.1
#6 lore raw

Re: [PATCH 2/4] generic/594: Fix test failure for xfs on older quota-tools

Quoted 14 lines · Darrick J. Wong
Quoted 5 lines · Anju T Sudhakar

For xfs we need the quota-tools containing commit fdd774bf08e568 ("quota-tools: pass quota type to QCMD for Q_XFS_GETQSTAT")to run this test. Otherwise this test will fail on xfs, as the grace time is not set correctly. So check for the quota-tool with the required commit before running this test on xfs.

This is a regression test for a kernel bug where Q_XGETQSTAT[V] ignores the quota type that userspace specifies in the system call and instead returns information about the first enabled quotatype. It just so happens that quota-tools /also/ had a bug where it would never send the user's quota type to the kernel, so nobody noticed the nested herp and derp.

Quoted 3 lines

The test should probably have mentioned kernel commit 555b2c3da1fc ("quota: honor quota type in Q_XGETQSTAT[V] calls") directly to make this more obvious.

Agreed, and maybe mention the quota-tools commit as well.

Thanks,
Eryu

Quoted 38 lines

--D

Quoted 35 lines
---
 tests/generic/594 | 6 ++++++
 1 file changed, 6 insertions(+)
tests/generic/594 +6 -0
index 88f9a0dc..668c1fae 100755
@@ -6,6 +6,8 @@
 #
 # Test per-type(user, group and project) filesystem quota timers, make sure
 # each of grace time can be set/get properly.
+# For xfs, you need a quota-tools containing commit fdd774bf08e568 for this
+# test to run properly- v4.06 should do.
 #
 . ./common/preamble
 _begin_fstest auto quick quota
@@ -18,9 +20,13 @@ _begin_fstest auto quick quota
 _supported_fs generic
 _require_scratch
 _require_setquota_project
+version=$(setquota -V | head -n1 | cut -d" " -f4)
 # V4 XFS doesn't support to mount project and group quota together
 if [ "$FSTYP" = "xfs" ];then
 	_require_scratch_xfs_crc
+	if [ "$version" \< "4.06" ];then
+		_notrun "This test requires quota-tools 4.06 or greater"
+	fi
 fi
 _require_quota
 
Signature · 1 line
2.24.1
#7 lore raw

Re: [PATCH 2/4] generic/594: Fix test failure for xfs on older quota-tools

Quoted 15 lines · Eryu Guan
Quoted 14 lines · Darrick J. Wong
Quoted 5 lines · Anju T Sudhakar

For xfs we need the quota-tools containing commit fdd774bf08e568 ("quota-tools: pass quota type to QCMD for Q_XFS_GETQSTAT")to run this test. Otherwise this test will fail on xfs, as the grace time is not set correctly. So check for the quota-tool with the required commit before running this test on xfs.

This is a regression test for a kernel bug where Q_XGETQSTAT[V] ignores the quota type that userspace specifies in the system call and instead returns information about the first enabled quotatype. It just so happens that quota-tools /also/ had a bug where it would never send the user's quota type to the kernel, so nobody noticed the nested herp and derp.

Quoted 5 lines
Quoted 3 lines

The test should probably have mentioned kernel commit 555b2c3da1fc ("quota: honor quota type in Q_XGETQSTAT[V] calls") directly to make this more obvious.

Agreed, and maybe mention the quota-tools commit as well.

I think recording kernel commit and package commit(not only in commit message but also in comment at the begin of test case) should become a habit when it is a regression test. It is more friendly to user.

Best Regards
Yang Xu

Quoted 44 lines

Thanks,
Eryu

Quoted 38 lines

--D

Quoted 35 lines
---
  tests/generic/594 | 6 ++++++
  1 file changed, 6 insertions(+)
tests/generic/594 +6 -1
index 88f9a0dc..668c1fae 100755
@@ -6,6 +6,8 @@
  #
  # Test per-type(user, group and project) filesystem quota timers, make sure
  # each of grace time can be set/get properly.
+# For xfs, you need a quota-tools containing commit fdd774bf08e568 for this
+# test to run properly- v4.06 should do.
  #
  . ./common/preamble
  _begin_fstest auto quick quota
@@ -18,9 +20,13 @@ _begin_fstest auto quick quota
  _supported_fs generic
  _require_scratch
  _require_setquota_project
+version=$(setquota -V | head -n1 | cut -d" " -f4)
  # V4 XFS doesn't support to mount project and group quota together
  if [ "$FSTYP" = "xfs" ];then
  	_require_scratch_xfs_crc
+	if [ "$version" \<  "4.06" ];then
+		_notrun "This test requires quota-tools 4.06 or greater"
+	fi
  fi
  _require_quota
 
--

2.24.1

#8 lore raw

PATCH 3/4 generic/600: Fix this test on xfs with older quota-tools

In reply to Anju T Sudhakar

For xfs, we need quota-tools containing commit be96da2353669d ("quota-tools:
Set FS_DQ_TIMER_MASK for individual xfs grace times"), to run this test. Otherwise the test fails on xfs. Check the quota-tools before running the test.

---
 tests/generic/600 | 8 ++++++++
 1 file changed, 8 insertions(+)
tests/generic/600 +8 -0
index a4233ecc..c8dc1bd5 100755
@@ -10,6 +10,9 @@
 # This test only exercises user quota because it's not known whether the
 # filesystem can set individual grace timers for each quota type
 #
+# For xfs, you need a quota-tools containing commit be96da2353669d to
+# run this test properly- 4.06 should do.
+
 . ./common/preamble
 _begin_fstest auto quick quota
 
@@ -24,6 +27,11 @@ _require_quota
 _require_user
 _require_setquota_project
 
+version=$(setquota -V | head -n1 | cut -d" " -f4)
+if [ "$FSTYP" = "xfs" ] && [ "$version" \< "4.06" ];then
+	_notrun "This test requires quota-tools 4.06 or greater"
+fi
+
 _scratch_mkfs >$seqres.full 2>&1
 _qmount_option "usrquota"
 _qmount
Signature · 1 line
2.24.1
#9 lore raw

PATCH 4/4 generic/219: Fix test failure on 64k block size

In reply to Anju T Sudhakar

Skip this test on 64k, as 4k as taken as the default block size.

---
But I have a Query:
This test fails on ext4&xfs with 64k block size. Do we need to rephrase this test to incorporate the 64k bs scenario as well? If not we can skip this test.

 tests/generic/219 | 5 +++++
 1 file changed, 5 insertions(+)
tests/generic/219 +5 -0
index d3d257f1..d38fd033 100755
@@ -79,6 +79,11 @@ test_accounting()
 
 # real QA test starts here
 
+# Skip this test on 64k block size scenario
+bsize=$(_get_block_size $SCRATCH_MNT)
+if [ $bsize -ge 4096 ];then
+	_notrun "Test assumes 4k as the default block size"
+fi
 _scratch_unmount 2>/dev/null
 _scratch_mkfs >> $seqres.full 2>&1
 _scratch_mount "-o usrquota,grpquota"
Signature · 1 line
2.24.1
#10 lore raw

Re: [PATCH 4/4] generic/219: Fix test failure on 64k block size

Quoted 8 lines · Anju T Sudhakar

Skip this test on 64k, as 4k as taken as the default block size.

---
But I have a Query:
This test fails on ext4&xfs with 64k block size. Do we need to rephrase this test to incorporate the 64k bs scenario as well? If not we can skip this test.

Right, we should fix the test to use multiples of block size rather than fixed byte sizes as we do for all the other tests that need to work across different block sizes. e.g. probe the block size after mkfs and then convert the "48k" numbers to "$((12 * $bs))".

Cheers,

Dave.

Signature · 2 lines
Dave Chinner
[email protected]
#11 lore raw

Re: [PATCH 4/4] generic/219: Fix test failure on 64k block size

Quoted 10 lines · Dave Chinner
Quoted 8 lines · Anju T Sudhakar

Skip this test on 64k, as 4k as taken as the default block size.

---
But I have a Query:
This test fails on ext4&xfs with 64k block size. Do we need to rephrase this test to incorporate the 64k bs scenario as well? If not we can skip this test.

Quoted 4 lines

Right, we should fix the test to use multiples of block size rather than fixed byte sizes as we do for all the other tests that need to work across different block sizes. e.g. probe the block size after mkfs and then convert the "48k" numbers to "$((12 * $bs))".

... and then make sure that you understand what the test is trying to do, and with those changes, audit the test to make sure it is correct and valid when the block size is as small as 1k, and as large as 64k. It might require adjusting other parameters, including the size of the scratch file system, etc.

Cheers,

- Ted