All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs/549: test mkfs.xfs whether terminate getsubopt arrays properly
@ 2022-07-20  5:45 Yang Xu
  2022-07-20 17:21 ` Darrick J. Wong
  0 siblings, 1 reply; 5+ messages in thread
From: Yang Xu @ 2022-07-20  5:45 UTC (permalink / raw)
  To: fstests; +Cc: djwong, Yang Xu

When I run xfs/144 manually, the step as below:
mkfs.xfs -f -d agcount=3200,size=6366g -d file,n

I accidentally pressed the Enter key, it triggers Segmentation fault.
Then I found Darrick has fixed this one weeks ago. So add this test.

Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 tests/xfs/549     | 33 +++++++++++++++++++++++++++++++++
 tests/xfs/549.out |  2 ++
 2 files changed, 35 insertions(+)
 create mode 100755 tests/xfs/549
 create mode 100644 tests/xfs/549.out

diff --git a/tests/xfs/549 b/tests/xfs/549
new file mode 100755
index 00000000..31ead3c7
--- /dev/null
+++ b/tests/xfs/549
@@ -0,0 +1,33 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2022 FUJITSU LIMITED. All rights reserved.
+#
+# FS QA Test 549
+#
+# Regression test for xfsprogs commit
+# 50dba8189b1f ("mkfs: terminate getsubopt arrays properly")
+#
+# This case test mkfs.xfs whether can terminate getsubopt arrays properly.
+# If not, it will trigger segmentation fault.
+#
+
+. ./common/preamble
+_begin_fstest auto quick mkfs
+
+# real QA test starts here
+_supported_fs xfs
+_fixed_by_git_commit xfsprogs 50dba8189b1f \
+	"mkfs: terminate getsubopt arrays properly"
+_require_test
+
+testfile=$TEST_DIR/a
+rm -rf $testfile
+
+$MKFS_XFS_PROG -f -d agcount=4 -d file,name=$testfile,nrext64=0 \
+	>> $seqres.full  2>&1
+
+echo "Silence is golden"
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/549.out b/tests/xfs/549.out
new file mode 100644
index 00000000..4e3acd3f
--- /dev/null
+++ b/tests/xfs/549.out
@@ -0,0 +1,2 @@
+QA output created by 549
+Silence is golden
-- 
2.23.0


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

* Re: [PATCH] xfs/549: test mkfs.xfs whether terminate getsubopt arrays properly
  2022-07-20  5:45 [PATCH] xfs/549: test mkfs.xfs whether terminate getsubopt arrays properly Yang Xu
@ 2022-07-20 17:21 ` Darrick J. Wong
  2022-07-21 16:43   ` Zorro Lang
  0 siblings, 1 reply; 5+ messages in thread
From: Darrick J. Wong @ 2022-07-20 17:21 UTC (permalink / raw)
  To: Yang Xu; +Cc: fstests

On Wed, Jul 20, 2022 at 01:45:37PM +0800, Yang Xu wrote:
> When I run xfs/144 manually, the step as below:
> mkfs.xfs -f -d agcount=3200,size=6366g -d file,n
> 
> I accidentally pressed the Enter key, it triggers Segmentation fault.
> Then I found Darrick has fixed this one weeks ago. So add this test.
> 
> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
> ---
>  tests/xfs/549     | 33 +++++++++++++++++++++++++++++++++
>  tests/xfs/549.out |  2 ++
>  2 files changed, 35 insertions(+)
>  create mode 100755 tests/xfs/549
>  create mode 100644 tests/xfs/549.out
> 
> diff --git a/tests/xfs/549 b/tests/xfs/549
> new file mode 100755
> index 00000000..31ead3c7
> --- /dev/null
> +++ b/tests/xfs/549
> @@ -0,0 +1,33 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2022 FUJITSU LIMITED. All rights reserved.
> +#
> +# FS QA Test 549
> +#
> +# Regression test for xfsprogs commit
> +# 50dba8189b1f ("mkfs: terminate getsubopt arrays properly")
> +#
> +# This case test mkfs.xfs whether can terminate getsubopt arrays properly.
> +# If not, it will trigger segmentation fault.
> +#
> +
> +. ./common/preamble
> +_begin_fstest auto quick mkfs
> +
> +# real QA test starts here
> +_supported_fs xfs
> +_fixed_by_git_commit xfsprogs 50dba8189b1f \
> +	"mkfs: terminate getsubopt arrays properly"
> +_require_test
> +
> +testfile=$TEST_DIR/a
> +rm -rf $testfile
> +
> +$MKFS_XFS_PROG -f -d agcount=4 -d file,name=$testfile,nrext64=0 \
> +	>> $seqres.full  2>&1

Heh, you don't even need $testfile --

"$MKFS_XFS_PROG -d agcount=3 -d garbagegarbagegarbage=0"

is enough to cause the crash.  But this works just as well, so

Reviewed-by: Darrick J. Wong <djwong@kernel.org>

--D

> +
> +echo "Silence is golden"
> +
> +# success, all done
> +status=0
> +exit
> diff --git a/tests/xfs/549.out b/tests/xfs/549.out
> new file mode 100644
> index 00000000..4e3acd3f
> --- /dev/null
> +++ b/tests/xfs/549.out
> @@ -0,0 +1,2 @@
> +QA output created by 549
> +Silence is golden
> -- 
> 2.23.0
> 

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

* Re: [PATCH] xfs/549: test mkfs.xfs whether terminate getsubopt arrays properly
  2022-07-20 17:21 ` Darrick J. Wong
@ 2022-07-21 16:43   ` Zorro Lang
  2022-07-22  1:52     ` xuyang2018.jy
  2022-07-22  3:43     ` [PATCH v2] xfs: " Yang Xu
  0 siblings, 2 replies; 5+ messages in thread
From: Zorro Lang @ 2022-07-21 16:43 UTC (permalink / raw)
  To: Darrick J. Wong; +Cc: Yang Xu, fstests

On Wed, Jul 20, 2022 at 10:21:19AM -0700, Darrick J. Wong wrote:
> On Wed, Jul 20, 2022 at 01:45:37PM +0800, Yang Xu wrote:
> > When I run xfs/144 manually, the step as below:
> > mkfs.xfs -f -d agcount=3200,size=6366g -d file,n
> > 
> > I accidentally pressed the Enter key, it triggers Segmentation fault.
> > Then I found Darrick has fixed this one weeks ago. So add this test.
> > 
> > Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
> > ---
> >  tests/xfs/549     | 33 +++++++++++++++++++++++++++++++++
> >  tests/xfs/549.out |  2 ++
> >  2 files changed, 35 insertions(+)
> >  create mode 100755 tests/xfs/549
> >  create mode 100644 tests/xfs/549.out
> > 
> > diff --git a/tests/xfs/549 b/tests/xfs/549
> > new file mode 100755
> > index 00000000..31ead3c7
> > --- /dev/null
> > +++ b/tests/xfs/549
> > @@ -0,0 +1,33 @@
> > +#! /bin/bash
> > +# SPDX-License-Identifier: GPL-2.0
> > +# Copyright (c) 2022 FUJITSU LIMITED. All rights reserved.
> > +#
> > +# FS QA Test 549
> > +#
> > +# Regression test for xfsprogs commit
> > +# 50dba8189b1f ("mkfs: terminate getsubopt arrays properly")
> > +#
> > +# This case test mkfs.xfs whether can terminate getsubopt arrays properly.
> > +# If not, it will trigger segmentation fault.
> > +#
> > +
> > +. ./common/preamble
> > +_begin_fstest auto quick mkfs
> > +
> > +# real QA test starts here
> > +_supported_fs xfs
> > +_fixed_by_git_commit xfsprogs 50dba8189b1f \
> > +	"mkfs: terminate getsubopt arrays properly"
> > +_require_test
> > +
> > +testfile=$TEST_DIR/a
> > +rm -rf $testfile
> > +
> > +$MKFS_XFS_PROG -f -d agcount=4 -d file,name=$testfile,nrext64=0 \
> > +	>> $seqres.full  2>&1
> 
> Heh, you don't even need $testfile --
> 
> "$MKFS_XFS_PROG -d agcount=3 -d garbagegarbagegarbage=0"
> 
> is enough to cause the crash.  But this works just as well, so

Thanks Darrick.

If it's not needed, let's remove those meaningless lines, likes

  testfile=$TEST_DIR/a
  rm -rf $testfile
  $MKFS_XFS_PROG -f -d agcount=4 -d file,name=$testfile,nrext64=0

That makes me feel this test need "EEXIST" error, to trigger this bug :)

Thanks,
Zorro


> 
> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
> 
> --D
> 
> > +
> > +echo "Silence is golden"
> > +
> > +# success, all done
> > +status=0
> > +exit
> > diff --git a/tests/xfs/549.out b/tests/xfs/549.out
> > new file mode 100644
> > index 00000000..4e3acd3f
> > --- /dev/null
> > +++ b/tests/xfs/549.out
> > @@ -0,0 +1,2 @@
> > +QA output created by 549
> > +Silence is golden
> > -- 
> > 2.23.0
> > 
> 


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

* Re: [PATCH] xfs/549: test mkfs.xfs whether terminate getsubopt arrays properly
  2022-07-21 16:43   ` Zorro Lang
@ 2022-07-22  1:52     ` xuyang2018.jy
  2022-07-22  3:43     ` [PATCH v2] xfs: " Yang Xu
  1 sibling, 0 replies; 5+ messages in thread
From: xuyang2018.jy @ 2022-07-22  1:52 UTC (permalink / raw)
  To: Zorro Lang, Darrick J. Wong; +Cc: fstests

on 2022/07/22 0:43, Zorro Lang wrote:
> On Wed, Jul 20, 2022 at 10:21:19AM -0700, Darrick J. Wong wrote:
>> On Wed, Jul 20, 2022 at 01:45:37PM +0800, Yang Xu wrote:
>>> When I run xfs/144 manually, the step as below:
>>> mkfs.xfs -f -d agcount=3200,size=6366g -d file,n
>>>
>>> I accidentally pressed the Enter key, it triggers Segmentation fault.
>>> Then I found Darrick has fixed this one weeks ago. So add this test.
>>>
>>> Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
>>> ---
>>>   tests/xfs/549     | 33 +++++++++++++++++++++++++++++++++
>>>   tests/xfs/549.out |  2 ++
>>>   2 files changed, 35 insertions(+)
>>>   create mode 100755 tests/xfs/549
>>>   create mode 100644 tests/xfs/549.out
>>>
>>> diff --git a/tests/xfs/549 b/tests/xfs/549
>>> new file mode 100755
>>> index 00000000..31ead3c7
>>> --- /dev/null
>>> +++ b/tests/xfs/549
>>> @@ -0,0 +1,33 @@
>>> +#! /bin/bash
>>> +# SPDX-License-Identifier: GPL-2.0
>>> +# Copyright (c) 2022 FUJITSU LIMITED. All rights reserved.
>>> +#
>>> +# FS QA Test 549
>>> +#
>>> +# Regression test for xfsprogs commit
>>> +# 50dba8189b1f ("mkfs: terminate getsubopt arrays properly")
>>> +#
>>> +# This case test mkfs.xfs whether can terminate getsubopt arrays properly.
>>> +# If not, it will trigger segmentation fault.
>>> +#
>>> +
>>> +. ./common/preamble
>>> +_begin_fstest auto quick mkfs
>>> +
>>> +# real QA test starts here
>>> +_supported_fs xfs
>>> +_fixed_by_git_commit xfsprogs 50dba8189b1f \
>>> +	"mkfs: terminate getsubopt arrays properly"
>>> +_require_test
>>> +
>>> +testfile=$TEST_DIR/a
>>> +rm -rf $testfile
>>> +
>>> +$MKFS_XFS_PROG -f -d agcount=4 -d file,name=$testfile,nrext64=0 \
>>> +	>> $seqres.full  2>&1
>>
>> Heh, you don't even need $testfile --
>>
>> "$MKFS_XFS_PROG -d agcount=3 -d garbagegarbagegarbage=0"
>>
>> is enough to cause the crash.  But this works just as well, so
> 
> Thanks Darrick.
> 
> If it's not needed, let's remove those meaningless lines, likes
> 
>    testfile=$TEST_DIR/a
>    rm -rf $testfile
>    $MKFS_XFS_PROG -f -d agcount=4 -d file,name=$testfile,nrext64=0
> 
> That makes me feel this test need "EEXIST" error, to trigger this bug :)

The reason is that I use the above commad to trigger this bug in xfs/144.

But this confuse you, so I will use ""$MKFS_XFS_PROG -d agcount=3 -d 
garbage=0" on v2.

Best Regards
Yang Xu
> 
> Thanks,
> Zorro
> 
> 
>>
>> Reviewed-by: Darrick J. Wong <djwong@kernel.org>
>>
>> --D
>>
>>> +
>>> +echo "Silence is golden"
>>> +
>>> +# success, all done
>>> +status=0
>>> +exit
>>> diff --git a/tests/xfs/549.out b/tests/xfs/549.out
>>> new file mode 100644
>>> index 00000000..4e3acd3f
>>> --- /dev/null
>>> +++ b/tests/xfs/549.out
>>> @@ -0,0 +1,2 @@
>>> +QA output created by 549
>>> +Silence is golden
>>> -- 
>>> 2.23.0
>>>
>>
> 

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

* [PATCH v2] xfs: test mkfs.xfs whether terminate getsubopt arrays properly
  2022-07-21 16:43   ` Zorro Lang
  2022-07-22  1:52     ` xuyang2018.jy
@ 2022-07-22  3:43     ` Yang Xu
  1 sibling, 0 replies; 5+ messages in thread
From: Yang Xu @ 2022-07-22  3:43 UTC (permalink / raw)
  To: fstests; +Cc: Yang Xu

When I run xfs/144 manually, the step as below:
mkfs.xfs -f -d agcount=3200,size=6366g -d file,n

I accidentally pressed the Enter key, it triggers Segmentation fault.
Then I found Darrick has fixed this one week ago. So add this test.

Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Yang Xu <xuyang2018.jy@fujitsu.com>
---
 tests/xfs/549     | 29 +++++++++++++++++++++++++++++
 tests/xfs/549.out |  2 ++
 2 files changed, 31 insertions(+)
 create mode 100755 tests/xfs/549
 create mode 100644 tests/xfs/549.out

diff --git a/tests/xfs/549 b/tests/xfs/549
new file mode 100755
index 00000000..7d4fc8cf
--- /dev/null
+++ b/tests/xfs/549
@@ -0,0 +1,29 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2022 FUJITSU LIMITED. All rights reserved.
+#
+# FS QA Test 549
+#
+# Regression test for xfsprogs commit
+# 50dba8189b1f ("mkfs: terminate getsubopt arrays properly")
+#
+# This case test mkfs.xfs whether can terminate getsubopt arrays properly.
+# If not, it will trigger segmentation fault.
+#
+
+. ./common/preamble
+_begin_fstest auto quick mkfs
+
+# real QA test starts here
+_supported_fs xfs
+_fixed_by_git_commit xfsprogs 50dba8189b1f \
+	"mkfs: terminate getsubopt arrays properly"
+_require_test
+
+$MKFS_XFS_PROG -f -d agcount=4 -d garbage=0 >> $seqres.full  2>&1
+
+echo "Silence is golden"
+
+# success, all done
+status=0
+exit
diff --git a/tests/xfs/549.out b/tests/xfs/549.out
new file mode 100644
index 00000000..4e3acd3f
--- /dev/null
+++ b/tests/xfs/549.out
@@ -0,0 +1,2 @@
+QA output created by 549
+Silence is golden
-- 
2.23.0


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

end of thread, other threads:[~2022-07-22  2:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-20  5:45 [PATCH] xfs/549: test mkfs.xfs whether terminate getsubopt arrays properly Yang Xu
2022-07-20 17:21 ` Darrick J. Wong
2022-07-21 16:43   ` Zorro Lang
2022-07-22  1:52     ` xuyang2018.jy
2022-07-22  3:43     ` [PATCH v2] xfs: " Yang Xu

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.