diff mbox series

[06/11] xfs/018: disable parent pointers for this test

Message ID 168506060929.3732476.6482579916222371853.stgit@frogsfrogsfrogs (mailing list archive)
State New, archived
Headers show
Series [01/11] xfs/206: filter out the parent= status from mkfs | expand

Commit Message

Darrick J. Wong May 26, 2023, 2:03 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

This test depends heavily on the xattr formats created for new files.
Parent pointers break those assumptions, so force parent pointers off.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
---
 tests/xfs/018 |    7 ++++++-
 tests/xfs/191 |    7 ++++++-
 tests/xfs/288 |    7 ++++++-
 3 files changed, 18 insertions(+), 3 deletions(-)

Comments

Zorro Lang May 26, 2023, 8:01 p.m. UTC | #1
On Thu, May 25, 2023 at 07:03:39PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <djwong@kernel.org>
> 
> This test depends heavily on the xattr formats created for new files.
> Parent pointers break those assumptions, so force parent pointers off.
> 
> Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> ---
>  tests/xfs/018 |    7 ++++++-
>  tests/xfs/191 |    7 ++++++-
>  tests/xfs/288 |    7 ++++++-
>  3 files changed, 18 insertions(+), 3 deletions(-)
> 
> 
> diff --git a/tests/xfs/018 b/tests/xfs/018
> index 1ef51a2e61..34b6e91579 100755
> --- a/tests/xfs/018
> +++ b/tests/xfs/018
> @@ -100,7 +100,12 @@ attr32l="X$attr32k"
>  attr64k="$attr32k$attr32k"
>  
>  echo "*** mkfs"
> -_scratch_mkfs >/dev/null
> +
> +# Parent pointers change the xattr formats sufficiently to break this test.
> +# Disable parent pointers if mkfs supports it.
> +mkfs_args=()
> +$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)

Maybe we need a _require_no_xfs_parent() ?

Thanks,
Zorro

> +_scratch_mkfs "${mkfs_args[@]}" >/dev/null
>  
>  blk_sz=$(_scratch_xfs_get_sb_field blocksize)
>  err_inj_attr_sz=$(( blk_sz / 3 - 50 ))
> diff --git a/tests/xfs/191 b/tests/xfs/191
> index 7a02f1be21..0a6c20dad7 100755
> --- a/tests/xfs/191
> +++ b/tests/xfs/191
> @@ -33,7 +33,12 @@ _fixed_by_kernel_commit 7be3bd8856fb "xfs: empty xattr leaf header blocks are no
>  _fixed_by_kernel_commit e87021a2bc10 "xfs: use larger in-core attr firstused field and detect overflow"
>  _fixed_by_git_commit xfsprogs f50d3462c654 "xfs_repair: ignore empty xattr leaf blocks"
>  
> -_scratch_mkfs_xfs | _filter_mkfs >$seqres.full 2>$tmp.mkfs
> +# Parent pointers change the xattr formats sufficiently to break this test.
> +# Disable parent pointers if mkfs supports it.
> +mkfs_args=()
> +$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
> +
> +_scratch_mkfs_xfs "${mkfs_args[@]}" | _filter_mkfs >$seqres.full 2>$tmp.mkfs
>  cat $tmp.mkfs >> $seqres.full
>  source $tmp.mkfs
>  _scratch_mount
> diff --git a/tests/xfs/288 b/tests/xfs/288
> index aa664a266e..6bfc9ac0c8 100755
> --- a/tests/xfs/288
> +++ b/tests/xfs/288
> @@ -19,8 +19,13 @@ _supported_fs xfs
>  _require_scratch
>  _require_attrs
>  
> +# Parent pointers change the xattr formats sufficiently to break this test.
> +# Disable parent pointers if mkfs supports it.
> +mkfs_args=()
> +$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
> +
>  # get block size ($dbsize) from the mkfs output
> -_scratch_mkfs_xfs 2>/dev/null | _filter_mkfs 2>$tmp.mkfs >/dev/null
> +_scratch_mkfs_xfs "${mkfs_args[@]}" 2>/dev/null | _filter_mkfs 2>$tmp.mkfs >/dev/null
>  . $tmp.mkfs
>  
>  _scratch_mount
>
Darrick J. Wong June 2, 2023, 1:06 a.m. UTC | #2
On Sat, May 27, 2023 at 04:01:34AM +0800, Zorro Lang wrote:
> On Thu, May 25, 2023 at 07:03:39PM -0700, Darrick J. Wong wrote:
> > From: Darrick J. Wong <djwong@kernel.org>
> > 
> > This test depends heavily on the xattr formats created for new files.
> > Parent pointers break those assumptions, so force parent pointers off.
> > 
> > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > ---
> >  tests/xfs/018 |    7 ++++++-
> >  tests/xfs/191 |    7 ++++++-
> >  tests/xfs/288 |    7 ++++++-
> >  3 files changed, 18 insertions(+), 3 deletions(-)
> > 
> > 
> > diff --git a/tests/xfs/018 b/tests/xfs/018
> > index 1ef51a2e61..34b6e91579 100755
> > --- a/tests/xfs/018
> > +++ b/tests/xfs/018
> > @@ -100,7 +100,12 @@ attr32l="X$attr32k"
> >  attr64k="$attr32k$attr32k"
> >  
> >  echo "*** mkfs"
> > -_scratch_mkfs >/dev/null
> > +
> > +# Parent pointers change the xattr formats sufficiently to break this test.
> > +# Disable parent pointers if mkfs supports it.
> > +mkfs_args=()
> > +$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
> 
> Maybe we need a _require_no_xfs_parent() ?

We still want to run the test, we just don't want parent pointer
xattrs muddying up the golden output.

--D

> Thanks,
> Zorro
> 
> > +_scratch_mkfs "${mkfs_args[@]}" >/dev/null
> >  
> >  blk_sz=$(_scratch_xfs_get_sb_field blocksize)
> >  err_inj_attr_sz=$(( blk_sz / 3 - 50 ))
> > diff --git a/tests/xfs/191 b/tests/xfs/191
> > index 7a02f1be21..0a6c20dad7 100755
> > --- a/tests/xfs/191
> > +++ b/tests/xfs/191
> > @@ -33,7 +33,12 @@ _fixed_by_kernel_commit 7be3bd8856fb "xfs: empty xattr leaf header blocks are no
> >  _fixed_by_kernel_commit e87021a2bc10 "xfs: use larger in-core attr firstused field and detect overflow"
> >  _fixed_by_git_commit xfsprogs f50d3462c654 "xfs_repair: ignore empty xattr leaf blocks"
> >  
> > -_scratch_mkfs_xfs | _filter_mkfs >$seqres.full 2>$tmp.mkfs
> > +# Parent pointers change the xattr formats sufficiently to break this test.
> > +# Disable parent pointers if mkfs supports it.
> > +mkfs_args=()
> > +$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
> > +
> > +_scratch_mkfs_xfs "${mkfs_args[@]}" | _filter_mkfs >$seqres.full 2>$tmp.mkfs
> >  cat $tmp.mkfs >> $seqres.full
> >  source $tmp.mkfs
> >  _scratch_mount
> > diff --git a/tests/xfs/288 b/tests/xfs/288
> > index aa664a266e..6bfc9ac0c8 100755
> > --- a/tests/xfs/288
> > +++ b/tests/xfs/288
> > @@ -19,8 +19,13 @@ _supported_fs xfs
> >  _require_scratch
> >  _require_attrs
> >  
> > +# Parent pointers change the xattr formats sufficiently to break this test.
> > +# Disable parent pointers if mkfs supports it.
> > +mkfs_args=()
> > +$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
> > +
> >  # get block size ($dbsize) from the mkfs output
> > -_scratch_mkfs_xfs 2>/dev/null | _filter_mkfs 2>$tmp.mkfs >/dev/null
> > +_scratch_mkfs_xfs "${mkfs_args[@]}" 2>/dev/null | _filter_mkfs 2>$tmp.mkfs >/dev/null
> >  . $tmp.mkfs
> >  
> >  _scratch_mount
> > 
>
Zorro Lang June 2, 2023, 10:27 a.m. UTC | #3
On Thu, Jun 01, 2023 at 06:06:45PM -0700, Darrick J. Wong wrote:
> On Sat, May 27, 2023 at 04:01:34AM +0800, Zorro Lang wrote:
> > On Thu, May 25, 2023 at 07:03:39PM -0700, Darrick J. Wong wrote:
> > > From: Darrick J. Wong <djwong@kernel.org>
> > > 
> > > This test depends heavily on the xattr formats created for new files.
> > > Parent pointers break those assumptions, so force parent pointers off.
> > > 
> > > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > > ---
> > >  tests/xfs/018 |    7 ++++++-
> > >  tests/xfs/191 |    7 ++++++-
> > >  tests/xfs/288 |    7 ++++++-
> > >  3 files changed, 18 insertions(+), 3 deletions(-)
> > > 
> > > 
> > > diff --git a/tests/xfs/018 b/tests/xfs/018
> > > index 1ef51a2e61..34b6e91579 100755
> > > --- a/tests/xfs/018
> > > +++ b/tests/xfs/018
> > > @@ -100,7 +100,12 @@ attr32l="X$attr32k"
> > >  attr64k="$attr32k$attr32k"
> > >  
> > >  echo "*** mkfs"
> > > -_scratch_mkfs >/dev/null
> > > +
> > > +# Parent pointers change the xattr formats sufficiently to break this test.
> > > +# Disable parent pointers if mkfs supports it.
> > > +mkfs_args=()
> > > +$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
> > 
> > Maybe we need a _require_no_xfs_parent() ?
> 
> We still want to run the test, we just don't want parent pointer
> xattrs muddying up the golden output.

But if there's a specified MKFS_OPTIONS="... -n parent=1", this change will cause
the whole test fails, right?

> 
> --D
> 
> > Thanks,
> > Zorro
> > 
> > > +_scratch_mkfs "${mkfs_args[@]}" >/dev/null
> > >  
> > >  blk_sz=$(_scratch_xfs_get_sb_field blocksize)
> > >  err_inj_attr_sz=$(( blk_sz / 3 - 50 ))
> > > diff --git a/tests/xfs/191 b/tests/xfs/191
> > > index 7a02f1be21..0a6c20dad7 100755
> > > --- a/tests/xfs/191
> > > +++ b/tests/xfs/191
> > > @@ -33,7 +33,12 @@ _fixed_by_kernel_commit 7be3bd8856fb "xfs: empty xattr leaf header blocks are no
> > >  _fixed_by_kernel_commit e87021a2bc10 "xfs: use larger in-core attr firstused field and detect overflow"
> > >  _fixed_by_git_commit xfsprogs f50d3462c654 "xfs_repair: ignore empty xattr leaf blocks"
> > >  
> > > -_scratch_mkfs_xfs | _filter_mkfs >$seqres.full 2>$tmp.mkfs
> > > +# Parent pointers change the xattr formats sufficiently to break this test.
> > > +# Disable parent pointers if mkfs supports it.
> > > +mkfs_args=()
> > > +$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
> > > +
> > > +_scratch_mkfs_xfs "${mkfs_args[@]}" | _filter_mkfs >$seqres.full 2>$tmp.mkfs
> > >  cat $tmp.mkfs >> $seqres.full
> > >  source $tmp.mkfs
> > >  _scratch_mount
> > > diff --git a/tests/xfs/288 b/tests/xfs/288
> > > index aa664a266e..6bfc9ac0c8 100755
> > > --- a/tests/xfs/288
> > > +++ b/tests/xfs/288
> > > @@ -19,8 +19,13 @@ _supported_fs xfs
> > >  _require_scratch
> > >  _require_attrs
> > >  
> > > +# Parent pointers change the xattr formats sufficiently to break this test.
> > > +# Disable parent pointers if mkfs supports it.
> > > +mkfs_args=()
> > > +$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
> > > +
> > >  # get block size ($dbsize) from the mkfs output
> > > -_scratch_mkfs_xfs 2>/dev/null | _filter_mkfs 2>$tmp.mkfs >/dev/null
> > > +_scratch_mkfs_xfs "${mkfs_args[@]}" 2>/dev/null | _filter_mkfs 2>$tmp.mkfs >/dev/null
> > >  . $tmp.mkfs
> > >  
> > >  _scratch_mount
> > > 
> > 
>
Darrick J. Wong June 2, 2023, 2:29 p.m. UTC | #4
On Fri, Jun 02, 2023 at 06:27:44PM +0800, Zorro Lang wrote:
> On Thu, Jun 01, 2023 at 06:06:45PM -0700, Darrick J. Wong wrote:
> > On Sat, May 27, 2023 at 04:01:34AM +0800, Zorro Lang wrote:
> > > On Thu, May 25, 2023 at 07:03:39PM -0700, Darrick J. Wong wrote:
> > > > From: Darrick J. Wong <djwong@kernel.org>
> > > > 
> > > > This test depends heavily on the xattr formats created for new files.
> > > > Parent pointers break those assumptions, so force parent pointers off.
> > > > 
> > > > Signed-off-by: Darrick J. Wong <djwong@kernel.org>
> > > > ---
> > > >  tests/xfs/018 |    7 ++++++-
> > > >  tests/xfs/191 |    7 ++++++-
> > > >  tests/xfs/288 |    7 ++++++-
> > > >  3 files changed, 18 insertions(+), 3 deletions(-)
> > > > 
> > > > 
> > > > diff --git a/tests/xfs/018 b/tests/xfs/018
> > > > index 1ef51a2e61..34b6e91579 100755
> > > > --- a/tests/xfs/018
> > > > +++ b/tests/xfs/018
> > > > @@ -100,7 +100,12 @@ attr32l="X$attr32k"
> > > >  attr64k="$attr32k$attr32k"
> > > >  
> > > >  echo "*** mkfs"
> > > > -_scratch_mkfs >/dev/null
> > > > +
> > > > +# Parent pointers change the xattr formats sufficiently to break this test.
> > > > +# Disable parent pointers if mkfs supports it.
> > > > +mkfs_args=()
> > > > +$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
> > > 
> > > Maybe we need a _require_no_xfs_parent() ?
> > 
> > We still want to run the test, we just don't want parent pointer
> > xattrs muddying up the golden output.
> 
> But if there's a specified MKFS_OPTIONS="... -n parent=1", this change will cause
> the whole test fails, right?

Ahaha, thank you for pointing that out.  Yes, this should change
parent=X to parent=0 if it's specified, or add parent=0 if not.

--D

> > 
> > --D
> > 
> > > Thanks,
> > > Zorro
> > > 
> > > > +_scratch_mkfs "${mkfs_args[@]}" >/dev/null
> > > >  
> > > >  blk_sz=$(_scratch_xfs_get_sb_field blocksize)
> > > >  err_inj_attr_sz=$(( blk_sz / 3 - 50 ))
> > > > diff --git a/tests/xfs/191 b/tests/xfs/191
> > > > index 7a02f1be21..0a6c20dad7 100755
> > > > --- a/tests/xfs/191
> > > > +++ b/tests/xfs/191
> > > > @@ -33,7 +33,12 @@ _fixed_by_kernel_commit 7be3bd8856fb "xfs: empty xattr leaf header blocks are no
> > > >  _fixed_by_kernel_commit e87021a2bc10 "xfs: use larger in-core attr firstused field and detect overflow"
> > > >  _fixed_by_git_commit xfsprogs f50d3462c654 "xfs_repair: ignore empty xattr leaf blocks"
> > > >  
> > > > -_scratch_mkfs_xfs | _filter_mkfs >$seqres.full 2>$tmp.mkfs
> > > > +# Parent pointers change the xattr formats sufficiently to break this test.
> > > > +# Disable parent pointers if mkfs supports it.
> > > > +mkfs_args=()
> > > > +$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
> > > > +
> > > > +_scratch_mkfs_xfs "${mkfs_args[@]}" | _filter_mkfs >$seqres.full 2>$tmp.mkfs
> > > >  cat $tmp.mkfs >> $seqres.full
> > > >  source $tmp.mkfs
> > > >  _scratch_mount
> > > > diff --git a/tests/xfs/288 b/tests/xfs/288
> > > > index aa664a266e..6bfc9ac0c8 100755
> > > > --- a/tests/xfs/288
> > > > +++ b/tests/xfs/288
> > > > @@ -19,8 +19,13 @@ _supported_fs xfs
> > > >  _require_scratch
> > > >  _require_attrs
> > > >  
> > > > +# Parent pointers change the xattr formats sufficiently to break this test.
> > > > +# Disable parent pointers if mkfs supports it.
> > > > +mkfs_args=()
> > > > +$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
> > > > +
> > > >  # get block size ($dbsize) from the mkfs output
> > > > -_scratch_mkfs_xfs 2>/dev/null | _filter_mkfs 2>$tmp.mkfs >/dev/null
> > > > +_scratch_mkfs_xfs "${mkfs_args[@]}" 2>/dev/null | _filter_mkfs 2>$tmp.mkfs >/dev/null
> > > >  . $tmp.mkfs
> > > >  
> > > >  _scratch_mount
> > > > 
> > > 
> > 
>
diff mbox series

Patch

diff --git a/tests/xfs/018 b/tests/xfs/018
index 1ef51a2e61..34b6e91579 100755
--- a/tests/xfs/018
+++ b/tests/xfs/018
@@ -100,7 +100,12 @@  attr32l="X$attr32k"
 attr64k="$attr32k$attr32k"
 
 echo "*** mkfs"
-_scratch_mkfs >/dev/null
+
+# Parent pointers change the xattr formats sufficiently to break this test.
+# Disable parent pointers if mkfs supports it.
+mkfs_args=()
+$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
+_scratch_mkfs "${mkfs_args[@]}" >/dev/null
 
 blk_sz=$(_scratch_xfs_get_sb_field blocksize)
 err_inj_attr_sz=$(( blk_sz / 3 - 50 ))
diff --git a/tests/xfs/191 b/tests/xfs/191
index 7a02f1be21..0a6c20dad7 100755
--- a/tests/xfs/191
+++ b/tests/xfs/191
@@ -33,7 +33,12 @@  _fixed_by_kernel_commit 7be3bd8856fb "xfs: empty xattr leaf header blocks are no
 _fixed_by_kernel_commit e87021a2bc10 "xfs: use larger in-core attr firstused field and detect overflow"
 _fixed_by_git_commit xfsprogs f50d3462c654 "xfs_repair: ignore empty xattr leaf blocks"
 
-_scratch_mkfs_xfs | _filter_mkfs >$seqres.full 2>$tmp.mkfs
+# Parent pointers change the xattr formats sufficiently to break this test.
+# Disable parent pointers if mkfs supports it.
+mkfs_args=()
+$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
+
+_scratch_mkfs_xfs "${mkfs_args[@]}" | _filter_mkfs >$seqres.full 2>$tmp.mkfs
 cat $tmp.mkfs >> $seqres.full
 source $tmp.mkfs
 _scratch_mount
diff --git a/tests/xfs/288 b/tests/xfs/288
index aa664a266e..6bfc9ac0c8 100755
--- a/tests/xfs/288
+++ b/tests/xfs/288
@@ -19,8 +19,13 @@  _supported_fs xfs
 _require_scratch
 _require_attrs
 
+# Parent pointers change the xattr formats sufficiently to break this test.
+# Disable parent pointers if mkfs supports it.
+mkfs_args=()
+$MKFS_XFS_PROG 2>&1 | grep -q parent=0 && mkfs_args+=(-n parent=0)
+
 # get block size ($dbsize) from the mkfs output
-_scratch_mkfs_xfs 2>/dev/null | _filter_mkfs 2>$tmp.mkfs >/dev/null
+_scratch_mkfs_xfs "${mkfs_args[@]}" 2>/dev/null | _filter_mkfs 2>$tmp.mkfs >/dev/null
 . $tmp.mkfs
 
 _scratch_mount