* [PATCH] test unaligned punch hole at ENOSPC
@ 2018-09-24 11:47 Anand Jain
2018-09-26 6:39 ` [PATCH v2] " Anand Jain
2018-09-28 12:42 ` [PATCH] " Eryu Guan
0 siblings, 2 replies; 4+ messages in thread
From: Anand Jain @ 2018-09-24 11:47 UTC (permalink / raw)
To: fstests; +Cc: linux-btrfs
Try to punch hole with unaligned size and offset when the FS
returns ENOSPC
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
This test case fails on btrfs as of now.
tests/btrfs/172 | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/btrfs/172.out | 2 ++
tests/btrfs/group | 1 +
3 files changed, 69 insertions(+)
create mode 100755 tests/btrfs/172
create mode 100644 tests/btrfs/172.out
diff --git a/tests/btrfs/172 b/tests/btrfs/172
new file mode 100755
index 000000000000..9c32a173f912
--- /dev/null
+++ b/tests/btrfs/172
@@ -0,0 +1,66 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2018 Oracle. All Rights Reserved.
+#
+# FS QA Test 172
+#
+# Test if the unaligned (by size and offset) punch hole is successful when FS
+# is at ENOSPC.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+
+_scratch_mkfs_sized $((200 * 1024 *1024)) >> $seqres.full
+
+# max_inline helps to create regular extent
+_scratch_mount "-o max_inline=0,nodatacow"
+
+echo "Fill fs upto ENOSPC" >> $seqres.full
+dd status=none if=/dev/zero of=$SCRATCH_MNT/filler bs=512 >> $seqres.full 2>&1
+
+extent_size=$(_scratch_btrfs_sectorsize)
+unalign_by=512
+echo extent_size=$extent_size unalign_by=$unalign_by >> $seqres.full
+
+hole_offset=0
+hole_len=$unalign_by
+run_check fallocate -p -o $hole_offset -l $hole_len $SCRATCH_MNT/filler
+
+hole_offset=$(($extent_size + $unalign_by))
+hole_len=$(($extent_size - $unalign_by))
+run_check fallocate -p -o $hole_offset -l $hole_len $SCRATCH_MNT/filler
+
+hole_offset=$(($extent_size * 2 + $unalign_by))
+hole_len=$(($extent_size * 5))
+run_check fallocate -p -o $hole_offset -l $hole_len $SCRATCH_MNT/filler
+
+# success, all done
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/btrfs/172.out b/tests/btrfs/172.out
new file mode 100644
index 000000000000..ce2de3f0d107
--- /dev/null
+++ b/tests/btrfs/172.out
@@ -0,0 +1,2 @@
+QA output created by 172
+Silence is golden
diff --git a/tests/btrfs/group b/tests/btrfs/group
index feffc45b6564..7e1a638ab7e1 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -174,3 +174,4 @@
169 auto quick send
170 auto quick snapshot
171 auto quick qgroup
+172 auto quick
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH v2] test unaligned punch hole at ENOSPC
2018-09-24 11:47 [PATCH] test unaligned punch hole at ENOSPC Anand Jain
@ 2018-09-26 6:39 ` Anand Jain
2018-09-28 12:42 ` [PATCH] " Eryu Guan
1 sibling, 0 replies; 4+ messages in thread
From: Anand Jain @ 2018-09-26 6:39 UTC (permalink / raw)
To: linux-btrfs
Try to punch hole with unaligned size and offset when the FS
returns ENOSPC.
Signed-off-by: Anand Jain <anand.jain@oracle.com>
---
v1->v2: Use at least 256MB to test.
This test case fails on btrfs as of now.
tests/btrfs/172 | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++
tests/btrfs/172.out | 2 ++
tests/btrfs/group | 1 +
3 files changed, 69 insertions(+)
create mode 100755 tests/btrfs/172
create mode 100644 tests/btrfs/172.out
diff --git a/tests/btrfs/172 b/tests/btrfs/172
new file mode 100755
index 000000000000..e84e742a3f1a
--- /dev/null
+++ b/tests/btrfs/172
@@ -0,0 +1,66 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2018 Oracle. All Rights Reserved.
+#
+# FS QA Test 172
+#
+# Test if the unaligned (by size and offset) punch hole is successful when FS
+# is at ENOSPC.
+#
+seq=`basename $0`
+seqres=$RESULT_DIR/$seq
+echo "QA output created by $seq"
+
+here=`pwd`
+tmp=/tmp/$$
+status=1 # failure is the default!
+trap "_cleanup; exit \$status" 0 1 2 3 15
+
+_cleanup()
+{
+ cd /
+ rm -f $tmp.*
+}
+
+# get standard environment, filters and checks
+. ./common/rc
+. ./common/filter
+
+# remove previous $seqres.full before test
+rm -f $seqres.full
+
+# real QA test starts here
+
+# Modify as appropriate.
+_supported_fs generic
+_supported_os Linux
+_require_scratch
+
+_scratch_mkfs_sized $((256 * 1024 *1024)) >> $seqres.full
+
+# max_inline helps to create regular extent
+_scratch_mount "-o max_inline=0,nodatacow"
+
+echo "Fill fs upto ENOSPC" >> $seqres.full
+dd status=none if=/dev/zero of=$SCRATCH_MNT/filler bs=512 >> $seqres.full 2>&1
+
+extent_size=$(_scratch_btrfs_sectorsize)
+unalign_by=512
+echo extent_size=$extent_size unalign_by=$unalign_by >> $seqres.full
+
+hole_offset=0
+hole_len=$unalign_by
+run_check fallocate -p -o $hole_offset -l $hole_len $SCRATCH_MNT/filler
+
+hole_offset=$(($extent_size + $unalign_by))
+hole_len=$(($extent_size - $unalign_by))
+run_check fallocate -p -o $hole_offset -l $hole_len $SCRATCH_MNT/filler
+
+hole_offset=$(($extent_size * 2 + $unalign_by))
+hole_len=$(($extent_size * 5))
+run_check fallocate -p -o $hole_offset -l $hole_len $SCRATCH_MNT/filler
+
+# success, all done
+echo "Silence is golden"
+status=0
+exit
diff --git a/tests/btrfs/172.out b/tests/btrfs/172.out
new file mode 100644
index 000000000000..ce2de3f0d107
--- /dev/null
+++ b/tests/btrfs/172.out
@@ -0,0 +1,2 @@
+QA output created by 172
+Silence is golden
diff --git a/tests/btrfs/group b/tests/btrfs/group
index feffc45b6564..7e1a638ab7e1 100644
--- a/tests/btrfs/group
+++ b/tests/btrfs/group
@@ -174,3 +174,4 @@
169 auto quick send
170 auto quick snapshot
171 auto quick qgroup
+172 auto quick
--
1.8.3.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] test unaligned punch hole at ENOSPC
2018-09-24 11:47 [PATCH] test unaligned punch hole at ENOSPC Anand Jain
2018-09-26 6:39 ` [PATCH v2] " Anand Jain
@ 2018-09-28 12:42 ` Eryu Guan
2018-09-28 14:55 ` Anand Jain
1 sibling, 1 reply; 4+ messages in thread
From: Eryu Guan @ 2018-09-28 12:42 UTC (permalink / raw)
To: Anand Jain; +Cc: fstests, linux-btrfs
On Mon, Sep 24, 2018 at 07:47:39PM +0800, Anand Jain wrote:
> Try to punch hole with unaligned size and offset when the FS
> returns ENOSPC
>
> Signed-off-by: Anand Jain <anand.jain@oracle.com>
> ---
> This test case fails on btrfs as of now.
>
> tests/btrfs/172 | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++
> tests/btrfs/172.out | 2 ++
> tests/btrfs/group | 1 +
> 3 files changed, 69 insertions(+)
> create mode 100755 tests/btrfs/172
> create mode 100644 tests/btrfs/172.out
>
> diff --git a/tests/btrfs/172 b/tests/btrfs/172
> new file mode 100755
> index 000000000000..9c32a173f912
> --- /dev/null
> +++ b/tests/btrfs/172
> @@ -0,0 +1,66 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2018 Oracle. All Rights Reserved.
> +#
> +# FS QA Test 172
> +#
> +# Test if the unaligned (by size and offset) punch hole is successful when FS
> +# is at ENOSPC.
> +#
> +seq=`basename $0`
> +seqres=$RESULT_DIR/$seq
> +echo "QA output created by $seq"
> +
> +here=`pwd`
> +tmp=/tmp/$$
> +status=1 # failure is the default!
> +trap "_cleanup; exit \$status" 0 1 2 3 15
> +
> +_cleanup()
> +{
> + cd /
> + rm -f $tmp.*
> +}
> +
> +# get standard environment, filters and checks
> +. ./common/rc
> +. ./common/filter
> +
> +# remove previous $seqres.full before test
> +rm -f $seqres.full
> +
> +# real QA test starts here
> +
> +# Modify as appropriate.
> +_supported_fs generic
> +_supported_os Linux
> +_require_scratch
> +
> +_scratch_mkfs_sized $((200 * 1024 *1024)) >> $seqres.full
> +
> +# max_inline helps to create regular extent
> +_scratch_mount "-o max_inline=0,nodatacow"
> +
> +echo "Fill fs upto ENOSPC" >> $seqres.full
> +dd status=none if=/dev/zero of=$SCRATCH_MNT/filler bs=512 >> $seqres.full 2>&1
> +
> +extent_size=$(_scratch_btrfs_sectorsize)
> +unalign_by=512
> +echo extent_size=$extent_size unalign_by=$unalign_by >> $seqres.full
> +
> +hole_offset=0
> +hole_len=$unalign_by
> +run_check fallocate -p -o $hole_offset -l $hole_len $SCRATCH_MNT/filler
Please don't introduce new run_check/_run_btrfs_util_prog users, just
redirect output to /dev/null if the outputs don't matter. Please refer
to this thread
https://www.spinics.net/lists/linux-btrfs/msg80996.html
And use xfs_io fpunch command instead of bare 'fallocate -p', and check
xfs_io and kernel support on fpunch by calling
_require_xfs_io_comand "fpunch"
> +
> +hole_offset=$(($extent_size + $unalign_by))
> +hole_len=$(($extent_size - $unalign_by))
> +run_check fallocate -p -o $hole_offset -l $hole_len $SCRATCH_MNT/filler
> +
> +hole_offset=$(($extent_size * 2 + $unalign_by))
> +hole_len=$(($extent_size * 5))
> +run_check fallocate -p -o $hole_offset -l $hole_len $SCRATCH_MNT/filler
> +
> +# success, all done
> +echo "Silence is golden"
> +status=0
> +exit
> diff --git a/tests/btrfs/172.out b/tests/btrfs/172.out
> new file mode 100644
> index 000000000000..ce2de3f0d107
> --- /dev/null
> +++ b/tests/btrfs/172.out
> @@ -0,0 +1,2 @@
> +QA output created by 172
> +Silence is golden
> diff --git a/tests/btrfs/group b/tests/btrfs/group
> index feffc45b6564..7e1a638ab7e1 100644
> --- a/tests/btrfs/group
> +++ b/tests/btrfs/group
> @@ -174,3 +174,4 @@
> 169 auto quick send
> 170 auto quick snapshot
> 171 auto quick qgroup
> +172 auto quick
Add 'punch' group too.
Thanks,
Eryu
> --
> 1.8.3.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] test unaligned punch hole at ENOSPC
2018-09-28 12:42 ` [PATCH] " Eryu Guan
@ 2018-09-28 14:55 ` Anand Jain
0 siblings, 0 replies; 4+ messages in thread
From: Anand Jain @ 2018-09-28 14:55 UTC (permalink / raw)
To: Eryu Guan; +Cc: fstests, linux-btrfs
Oops I just realized I sent v2 only to linux-btrfs@vger.kernel.org.
more below..
On 09/28/2018 08:42 PM, Eryu Guan wrote:
> On Mon, Sep 24, 2018 at 07:47:39PM +0800, Anand Jain wrote:
>> Try to punch hole with unaligned size and offset when the FS
>> returns ENOSPC
>>
>> Signed-off-by: Anand Jain <anand.jain@oracle.com>
>> ---
>> This test case fails on btrfs as of now.
>>
>> tests/btrfs/172 | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++++
>> tests/btrfs/172.out | 2 ++
>> tests/btrfs/group | 1 +
>> 3 files changed, 69 insertions(+)
>> create mode 100755 tests/btrfs/172
>> create mode 100644 tests/btrfs/172.out
>>
>> diff --git a/tests/btrfs/172 b/tests/btrfs/172
>> new file mode 100755
>> index 000000000000..9c32a173f912
>> --- /dev/null
>> +++ b/tests/btrfs/172
>> @@ -0,0 +1,66 @@
>> +#! /bin/bash
>> +# SPDX-License-Identifier: GPL-2.0
>> +# Copyright (c) 2018 Oracle. All Rights Reserved.
>> +#
>> +# FS QA Test 172
>> +#
>> +# Test if the unaligned (by size and offset) punch hole is successful when FS
>> +# is at ENOSPC.
>> +#
>> +seq=`basename $0`
>> +seqres=$RESULT_DIR/$seq
>> +echo "QA output created by $seq"
>> +
>> +here=`pwd`
>> +tmp=/tmp/$$
>> +status=1 # failure is the default!
>> +trap "_cleanup; exit \$status" 0 1 2 3 15
>> +
>> +_cleanup()
>> +{
>> + cd /
>> + rm -f $tmp.*
>> +}
>> +
>> +# get standard environment, filters and checks
>> +. ./common/rc
>> +. ./common/filter
>> +
>> +# remove previous $seqres.full before test
>> +rm -f $seqres.full
>> +
>> +# real QA test starts here
>> +
>> +# Modify as appropriate.
>> +_supported_fs generic
>> +_supported_os Linux
>> +_require_scratch
>> +
>> +_scratch_mkfs_sized $((200 * 1024 *1024)) >> $seqres.full
>> +
>> +# max_inline helps to create regular extent
>> +_scratch_mount "-o max_inline=0,nodatacow"
>> +
>> +echo "Fill fs upto ENOSPC" >> $seqres.full
>> +dd status=none if=/dev/zero of=$SCRATCH_MNT/filler bs=512 >> $seqres.full 2>&1
>> +
>> +extent_size=$(_scratch_btrfs_sectorsize)
>> +unalign_by=512
>> +echo extent_size=$extent_size unalign_by=$unalign_by >> $seqres.full
>> +
>> +hole_offset=0
>> +hole_len=$unalign_by
>> +run_check fallocate -p -o $hole_offset -l $hole_len $SCRATCH_MNT/filler
>
> Please don't introduce new run_check/_run_btrfs_util_prog users, just
> redirect output to /dev/null if the outputs don't matter. Please refer
> to this thread
Fixed in v3.
> https://www.spinics.net/lists/linux-btrfs/msg80996.html
> And use xfs_io fpunch command instead of bare 'fallocate -p', and check
> xfs_io and kernel support on fpunch by calling
> _require_xfs_io_comand "fpunch"
Fixed in v3.
>> +
>> +hole_offset=$(($extent_size + $unalign_by))
>> +hole_len=$(($extent_size - $unalign_by))
>> +run_check fallocate -p -o $hole_offset -l $hole_len $SCRATCH_MNT/filler
>> +
>> +hole_offset=$(($extent_size * 2 + $unalign_by))
>> +hole_len=$(($extent_size * 5))
>> +run_check fallocate -p -o $hole_offset -l $hole_len $SCRATCH_MNT/filler
>> +
>> +# success, all done
>> +echo "Silence is golden"
>> +status=0
>> +exit
>> diff --git a/tests/btrfs/172.out b/tests/btrfs/172.out
>> new file mode 100644
>> index 000000000000..ce2de3f0d107
>> --- /dev/null
>> +++ b/tests/btrfs/172.out
>> @@ -0,0 +1,2 @@
>> +QA output created by 172
>> +Silence is golden
>> diff --git a/tests/btrfs/group b/tests/btrfs/group
>> index feffc45b6564..7e1a638ab7e1 100644
>> --- a/tests/btrfs/group
>> +++ b/tests/btrfs/group
>> @@ -174,3 +174,4 @@
>> 169 auto quick send
>> 170 auto quick snapshot
>> 171 auto quick qgroup
>> +172 auto quick
>
> Add 'punch' group too.
Ah there is punch group.. I was searching with the key word 'hole'.
Will fix in v4.
Thanks, Anand
> Thanks,
> Eryu
>
>> --
>> 1.8.3.1
>>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-09-28 14:55 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-24 11:47 [PATCH] test unaligned punch hole at ENOSPC Anand Jain
2018-09-26 6:39 ` [PATCH v2] " Anand Jain
2018-09-28 12:42 ` [PATCH] " Eryu Guan
2018-09-28 14:55 ` Anand Jain
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.