* [f2fs-dev] [PATCH v2] f2fs/011: test to check out-of-space issue
@ 2025-03-27 5:50 Chao Yu via Linux-f2fs-devel
2025-04-25 14:13 ` Zorro Lang via Linux-f2fs-devel
0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2025-03-27 5:50 UTC (permalink / raw)
To: Zorro Lang, fstests; +Cc: jaegeuk, linux-f2fs-devel
This is a regression testcase to check whether we will handle
out-of-space case correctly during fallocate() on pinned file
once we disable checkpoint.
Testcase:
1. mount f2fs w/ checkpoint=disable option
2. create fragmented file data
3. set flag w/ pinned flag
4. fallocate space for pinned file, expects panic due to running
out of space.
We should apply both commit ("f2fs: fix to avoid panic once
fallocation fails for pinfile") and commit ("f2fs: fix to avoid
running out of free segments") to avoid system panic.
Note that w/ these two commit, we fixed such issue in both
convential and zoned block device.
Cc: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Chao Yu <chao@kernel.org>
---
v2:
- clean up codes suggested by Zorro
- change output to expect ENOSPC error if we have applied fixes
tests/f2fs/011 | 53 ++++++++++++++++++++++++++++++++++++++++++++++
tests/f2fs/011.out | 2 ++
2 files changed, 55 insertions(+)
create mode 100755 tests/f2fs/011
create mode 100644 tests/f2fs/011.out
diff --git a/tests/f2fs/011 b/tests/f2fs/011
new file mode 100755
index 00000000..ec3d39ec
--- /dev/null
+++ b/tests/f2fs/011
@@ -0,0 +1,53 @@
+#! /bin/bash
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2025 Chao Yu. All Rights Reserved.
+#
+# FS QA Test No. f2fs/011
+#
+# This is a regression testcase to check whether we will handle
+# out-of-space case correctly during fallocate() on pinned file
+# once we disable checkpoint.
+# 1. mount f2fs w/ checkpoint=disable option
+# 2. create fragmented file data
+# 3. set flag w/ pinned flag
+# 4. fallocate space for pinned file, expects panic due to running
+# out of space
+# We should apply both commit ("f2fs: fix to avoid panic once
+# fallocation fails for pinfile") and commit ("f2fs: fix to avoid
+# running out of free segments") to avoid system panic.
+# Note that w/ these two commit, we fixed such issue in both
+# convential and zoned block device.
+#
+. ./common/preamble
+_begin_fstest auto quick
+
+_fixed_by_kernel_commit 48ea8b200414 \
+ "f2fs: fix to avoid panic once fallocation fails for pinfile"
+_fixed_by_kernel_commit xxxxxxxxxxxx \
+ "f2fs: fix to avoid running out of free segments"
+
+_require_scratch
+_require_command "$F2FS_IO_PROG" f2fs_io
+
+_scratch_mkfs_sized $((1*1024*1024*1024)) >> $seqres.full
+_scratch_mount -o checkpoint=disable:10%
+
+pinfile=$SCRATCH_MNT/file
+
+# simulate fragment status in f2fs
+for ((i=0;i<256;i++)) do
+ $XFS_IO_PROG -f -c "pwrite 0 1m" $SCRATCH_MNT/$i >>$seqres.full
+done
+sync
+
+for ((i=0;i<256;i+=2)) do
+ rm -f $SCRATCH_MNT/$i
+done
+sync
+
+touch $pinfile
+$F2FS_IO_PROG pinfile set $pinfile >> $seqres.full
+$XFS_IO_PROG -c "falloc 0 $((3*256*1024*1024))" $pinfile
+
+status=0
+exit
diff --git a/tests/f2fs/011.out b/tests/f2fs/011.out
new file mode 100644
index 00000000..559c3fdf
--- /dev/null
+++ b/tests/f2fs/011.out
@@ -0,0 +1,2 @@
+QA output created by 011
+fallocate: No space left on device
--
2.49.0
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH v2] f2fs/011: test to check out-of-space issue
2025-03-27 5:50 [f2fs-dev] [PATCH v2] f2fs/011: test to check out-of-space issue Chao Yu via Linux-f2fs-devel
@ 2025-04-25 14:13 ` Zorro Lang via Linux-f2fs-devel
2025-04-27 8:20 ` Chao Yu via Linux-f2fs-devel
0 siblings, 1 reply; 3+ messages in thread
From: Zorro Lang via Linux-f2fs-devel @ 2025-04-25 14:13 UTC (permalink / raw)
To: Chao Yu; +Cc: jaegeuk, Zorro Lang, fstests, linux-f2fs-devel
On Thu, Mar 27, 2025 at 01:50:51PM +0800, Chao Yu wrote:
> This is a regression testcase to check whether we will handle
> out-of-space case correctly during fallocate() on pinned file
> once we disable checkpoint.
>
> Testcase:
> 1. mount f2fs w/ checkpoint=disable option
> 2. create fragmented file data
> 3. set flag w/ pinned flag
> 4. fallocate space for pinned file, expects panic due to running
> out of space.
>
> We should apply both commit ("f2fs: fix to avoid panic once
> fallocation fails for pinfile") and commit ("f2fs: fix to avoid
> running out of free segments") to avoid system panic.
> Note that w/ these two commit, we fixed such issue in both
> convential and zoned block device.
>
> Cc: Jaegeuk Kim <jaegeuk@kernel.org>
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
> v2:
> - clean up codes suggested by Zorro
> - change output to expect ENOSPC error if we have applied fixes
Sorry I missed this V2, this version looks good to me. As there's not
more review points from f2fs list, so I'd like to merge it:
Reviewed-by: Zorro Lang <zlang@redhat.com>
> tests/f2fs/011 | 53 ++++++++++++++++++++++++++++++++++++++++++++++
> tests/f2fs/011.out | 2 ++
> 2 files changed, 55 insertions(+)
> create mode 100755 tests/f2fs/011
> create mode 100644 tests/f2fs/011.out
>
> diff --git a/tests/f2fs/011 b/tests/f2fs/011
> new file mode 100755
> index 00000000..ec3d39ec
> --- /dev/null
> +++ b/tests/f2fs/011
> @@ -0,0 +1,53 @@
> +#! /bin/bash
> +# SPDX-License-Identifier: GPL-2.0
> +# Copyright (c) 2025 Chao Yu. All Rights Reserved.
> +#
> +# FS QA Test No. f2fs/011
> +#
> +# This is a regression testcase to check whether we will handle
> +# out-of-space case correctly during fallocate() on pinned file
> +# once we disable checkpoint.
> +# 1. mount f2fs w/ checkpoint=disable option
> +# 2. create fragmented file data
> +# 3. set flag w/ pinned flag
> +# 4. fallocate space for pinned file, expects panic due to running
> +# out of space
> +# We should apply both commit ("f2fs: fix to avoid panic once
> +# fallocation fails for pinfile") and commit ("f2fs: fix to avoid
> +# running out of free segments") to avoid system panic.
> +# Note that w/ these two commit, we fixed such issue in both
> +# convential and zoned block device.
> +#
> +. ./common/preamble
> +_begin_fstest auto quick
> +
> +_fixed_by_kernel_commit 48ea8b200414 \
> + "f2fs: fix to avoid panic once fallocation fails for pinfile"
> +_fixed_by_kernel_commit xxxxxxxxxxxx \
> + "f2fs: fix to avoid running out of free segments"
> +
> +_require_scratch
> +_require_command "$F2FS_IO_PROG" f2fs_io
> +
> +_scratch_mkfs_sized $((1*1024*1024*1024)) >> $seqres.full
> +_scratch_mount -o checkpoint=disable:10%
> +
> +pinfile=$SCRATCH_MNT/file
> +
> +# simulate fragment status in f2fs
> +for ((i=0;i<256;i++)) do
> + $XFS_IO_PROG -f -c "pwrite 0 1m" $SCRATCH_MNT/$i >>$seqres.full
> +done
> +sync
> +
> +for ((i=0;i<256;i+=2)) do
> + rm -f $SCRATCH_MNT/$i
> +done
> +sync
> +
> +touch $pinfile
> +$F2FS_IO_PROG pinfile set $pinfile >> $seqres.full
> +$XFS_IO_PROG -c "falloc 0 $((3*256*1024*1024))" $pinfile
> +
> +status=0
> +exit
> diff --git a/tests/f2fs/011.out b/tests/f2fs/011.out
> new file mode 100644
> index 00000000..559c3fdf
> --- /dev/null
> +++ b/tests/f2fs/011.out
> @@ -0,0 +1,2 @@
> +QA output created by 011
> +fallocate: No space left on device
> --
> 2.49.0
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [f2fs-dev] [PATCH v2] f2fs/011: test to check out-of-space issue
2025-04-25 14:13 ` Zorro Lang via Linux-f2fs-devel
@ 2025-04-27 8:20 ` Chao Yu via Linux-f2fs-devel
0 siblings, 0 replies; 3+ messages in thread
From: Chao Yu via Linux-f2fs-devel @ 2025-04-27 8:20 UTC (permalink / raw)
To: Zorro Lang; +Cc: jaegeuk, Zorro Lang, fstests, linux-f2fs-devel
On 4/25/25 22:13, Zorro Lang wrote:
> On Thu, Mar 27, 2025 at 01:50:51PM +0800, Chao Yu wrote:
>> This is a regression testcase to check whether we will handle
>> out-of-space case correctly during fallocate() on pinned file
>> once we disable checkpoint.
>>
>> Testcase:
>> 1. mount f2fs w/ checkpoint=disable option
>> 2. create fragmented file data
>> 3. set flag w/ pinned flag
>> 4. fallocate space for pinned file, expects panic due to running
>> out of space.
>>
>> We should apply both commit ("f2fs: fix to avoid panic once
>> fallocation fails for pinfile") and commit ("f2fs: fix to avoid
>> running out of free segments") to avoid system panic.
>> Note that w/ these two commit, we fixed such issue in both
>> convential and zoned block device.
>>
>> Cc: Jaegeuk Kim <jaegeuk@kernel.org>
>> Signed-off-by: Chao Yu <chao@kernel.org>
>> ---
>> v2:
>> - clean up codes suggested by Zorro
>> - change output to expect ENOSPC error if we have applied fixes
>
> Sorry I missed this V2, this version looks good to me. As there's not
> more review points from f2fs list, so I'd like to merge it:
Thank you, Zorro.
Could you please take a look at this new testcase?
https://lore.kernel.org/fstests/20250415093822.1100476-1-chao@kernel.org
Thanks,
>
> Reviewed-by: Zorro Lang <zlang@redhat.com>
>
>> tests/f2fs/011 | 53 ++++++++++++++++++++++++++++++++++++++++++++++
>> tests/f2fs/011.out | 2 ++
>> 2 files changed, 55 insertions(+)
>> create mode 100755 tests/f2fs/011
>> create mode 100644 tests/f2fs/011.out
>>
>> diff --git a/tests/f2fs/011 b/tests/f2fs/011
>> new file mode 100755
>> index 00000000..ec3d39ec
>> --- /dev/null
>> +++ b/tests/f2fs/011
>> @@ -0,0 +1,53 @@
>> +#! /bin/bash
>> +# SPDX-License-Identifier: GPL-2.0
>> +# Copyright (c) 2025 Chao Yu. All Rights Reserved.
>> +#
>> +# FS QA Test No. f2fs/011
>> +#
>> +# This is a regression testcase to check whether we will handle
>> +# out-of-space case correctly during fallocate() on pinned file
>> +# once we disable checkpoint.
>> +# 1. mount f2fs w/ checkpoint=disable option
>> +# 2. create fragmented file data
>> +# 3. set flag w/ pinned flag
>> +# 4. fallocate space for pinned file, expects panic due to running
>> +# out of space
>> +# We should apply both commit ("f2fs: fix to avoid panic once
>> +# fallocation fails for pinfile") and commit ("f2fs: fix to avoid
>> +# running out of free segments") to avoid system panic.
>> +# Note that w/ these two commit, we fixed such issue in both
>> +# convential and zoned block device.
>> +#
>> +. ./common/preamble
>> +_begin_fstest auto quick
>> +
>> +_fixed_by_kernel_commit 48ea8b200414 \
>> + "f2fs: fix to avoid panic once fallocation fails for pinfile"
>> +_fixed_by_kernel_commit xxxxxxxxxxxx \
>> + "f2fs: fix to avoid running out of free segments"
>> +
>> +_require_scratch
>> +_require_command "$F2FS_IO_PROG" f2fs_io
>> +
>> +_scratch_mkfs_sized $((1*1024*1024*1024)) >> $seqres.full
>> +_scratch_mount -o checkpoint=disable:10%
>> +
>> +pinfile=$SCRATCH_MNT/file
>> +
>> +# simulate fragment status in f2fs
>> +for ((i=0;i<256;i++)) do
>> + $XFS_IO_PROG -f -c "pwrite 0 1m" $SCRATCH_MNT/$i >>$seqres.full
>> +done
>> +sync
>> +
>> +for ((i=0;i<256;i+=2)) do
>> + rm -f $SCRATCH_MNT/$i
>> +done
>> +sync
>> +
>> +touch $pinfile
>> +$F2FS_IO_PROG pinfile set $pinfile >> $seqres.full
>> +$XFS_IO_PROG -c "falloc 0 $((3*256*1024*1024))" $pinfile
>> +
>> +status=0
>> +exit
>> diff --git a/tests/f2fs/011.out b/tests/f2fs/011.out
>> new file mode 100644
>> index 00000000..559c3fdf
>> --- /dev/null
>> +++ b/tests/f2fs/011.out
>> @@ -0,0 +1,2 @@
>> +QA output created by 011
>> +fallocate: No space left on device
>> --
>> 2.49.0
>>
>
_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-27 8:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-27 5:50 [f2fs-dev] [PATCH v2] f2fs/011: test to check out-of-space issue Chao Yu via Linux-f2fs-devel
2025-04-25 14:13 ` Zorro Lang via Linux-f2fs-devel
2025-04-27 8:20 ` Chao Yu via Linux-f2fs-devel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).