linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH v3 0/3] Resend the three patches
@ 2021-06-30 11:37 Sun Ke
  2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 1/3] generic/042: make a bigger img for f2fs Sun Ke
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Sun Ke @ 2021-06-30 11:37 UTC (permalink / raw)
  To: fstests, linux-f2fs-devel, guan, chao; +Cc: sunke32

Resend the three patches

Sun Ke (3):
  generic/042: make a bigger img for f2fs
  generic/103: special left calculation for f2fs
  generic/260: f2fs is also special

 tests/generic/042 |  6 ++++--
 tests/generic/103 | 10 +++++++++-
 tests/generic/260 | 10 ++++++++--
 3 files changed, 21 insertions(+), 5 deletions(-)

-- 
2.25.4



_______________________________________________
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] 7+ messages in thread

* [f2fs-dev] [PATCH v3 1/3] generic/042: make a bigger img for f2fs
  2021-06-30 11:37 [f2fs-dev] [PATCH v3 0/3] Resend the three patches Sun Ke
@ 2021-06-30 11:37 ` Sun Ke
  2021-07-01 14:39   ` Chao Yu
  2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 2/3] generic/103: special left calculation " Sun Ke
  2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 3/3] generic/260: f2fs is also special Sun Ke
  2 siblings, 1 reply; 7+ messages in thread
From: Sun Ke @ 2021-06-30 11:37 UTC (permalink / raw)
  To: fstests, linux-f2fs-devel, guan, chao; +Cc: sunke32

f2fs-utils 1.9.0 needs at least 38 MB space for f2fs image. However,
f2fs-utils 1.14.0 needs at least 52 MB. Not sure if it will change again.
So, just set it to 128M.

Suggested-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Sun Ke <sunke32@huawei.com>
---
 tests/generic/042 | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tests/generic/042 b/tests/generic/042
index 88cc2098221e..9419606fc82f 100755
--- a/tests/generic/042
+++ b/tests/generic/042
@@ -29,9 +29,11 @@ _crashtest()
 	file=$mnt/file
 	size=25M
 
-	# 25M is too small for f2fs.
+	# f2fs-utils 1.9.0 needs at least 38 MB space for f2fs image. However,
+	# f2fs-utils 1.14.0 needs at least 52 MB. Not sure if it will change
+	# again. So just set it 128M.
 	if [ $FSTYP == "f2fs" ]; then
-		size=38M
+		size=128M
 	fi
 
 	# Create an fs on a small, initialized image. The pattern is written to
-- 
2.25.4



_______________________________________________
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] 7+ messages in thread

* [f2fs-dev] [PATCH v3 2/3] generic/103: special left calculation for f2fs
  2021-06-30 11:37 [f2fs-dev] [PATCH v3 0/3] Resend the three patches Sun Ke
  2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 1/3] generic/042: make a bigger img for f2fs Sun Ke
@ 2021-06-30 11:37 ` Sun Ke
  2021-07-01 14:40   ` Chao Yu
  2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 3/3] generic/260: f2fs is also special Sun Ke
  2 siblings, 1 reply; 7+ messages in thread
From: Sun Ke @ 2021-06-30 11:37 UTC (permalink / raw)
  To: fstests, linux-f2fs-devel, guan, chao; +Cc: sunke32

It failed on f2fs:
      QA output created by 103
     +fallocate: No space left on device
      Silence is golden.
     ...

f2fs uses index(radix) tree as mapping metadata, its space overhead
is about one thousandth of the data.

Suggested-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Sun Ke <sunke32@huawei.com>
---
 tests/generic/103 | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/tests/generic/103 b/tests/generic/103
index 795f851dc6c8..4efa1dc366f9 100755
--- a/tests/generic/103
+++ b/tests/generic/103
@@ -27,10 +27,18 @@ _require_xfs_io_command "falloc"
 _consume_freesp()
 {
 	file=$1
+	left=512
 
 	# consume nearly all available space (leave ~512kB)
 	avail=`_get_available_space $SCRATCH_MNT`
-	filesizekb=$((avail / 1024 - 512))
+
+	# f2fs uses index(radix) tree as mapping metadata, its space overhead
+	# is about one thousandth of the data
+	if [ $FSTYP == "f2fs" ]; then
+		left=$((left + avail / 1024000))
+	fi
+
+	filesizekb=$((avail / 1024 - $left))
 	$XFS_IO_PROG -fc "falloc 0 ${filesizekb}k" $file
 }
 
-- 
2.25.4



_______________________________________________
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] 7+ messages in thread

* [f2fs-dev] [PATCH v3 3/3] generic/260: f2fs is also special
  2021-06-30 11:37 [f2fs-dev] [PATCH v3 0/3] Resend the three patches Sun Ke
  2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 1/3] generic/042: make a bigger img for f2fs Sun Ke
  2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 2/3] generic/103: special left calculation " Sun Ke
@ 2021-06-30 11:37 ` Sun Ke
  2021-07-01 14:41   ` Chao Yu
  2 siblings, 1 reply; 7+ messages in thread
From: Sun Ke @ 2021-06-30 11:37 UTC (permalink / raw)
  To: fstests, linux-f2fs-devel, guan, chao; +Cc: sunke32

It fail on f2fs:

 [+] Default length with start set (should succeed)
 [+] Length beyond the end of fs (should succeed)
 [+] Length beyond the end of fs with start set (should succeed)
+After the full fs discard 0 bytes were discarded however the file system is 12882804736 bytes long.
+It seems that fs logic handling len argument overflows

The root cause is f2fs can tag a special flag TRIMMED_FLAG to indicate
the whole filesystem is trimmed, so after mkfs/fstrim(), following
fstrim() won't trim any block.

Suggested-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Sun Ke <sunke32@huawei.com>
---
 tests/generic/260 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tests/generic/260 b/tests/generic/260
index 8d6d6c79a5c1..b15b4e570bd1 100755
--- a/tests/generic/260
+++ b/tests/generic/260
@@ -95,7 +95,10 @@ fi
 # It is because btrfs does not have not-yet-used parts of the device
 # mapped and since we got here right after the mkfs, there is not
 # enough free extents in the root tree.
-if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ]; then
+# F2fs is also special. F2fs can tag a special flag TRIMMED_FLAG to
+# indicate the whole filesystem is trimmed, so after mkfs/fstrim(),
+# following fstrim() won't trim any block.
+if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ] && [ $FSTYP != "f2fs" ]; then
 	status=1
 	echo "After the full fs discard $bytes bytes were discarded"\
 	     "however the file system is $(_math "$fssize*1024") bytes long."
@@ -154,8 +157,11 @@ _scratch_mount
 # It is because btrfs does not have not-yet-used parts of the device
 # mapped and since we got here right after the mkfs, there is not
 # enough free extents in the root tree.
+# F2fs is also special. F2fs can tag a special flag TRIMMED_FLAG to
+# indicate the whole filesystem is trimmed, so after mkfs/fstrim(),
+# following fstrim() won't trim any block.
 bytes=$($FSTRIM_PROG -v -l$len $SCRATCH_MNT | _filter_fstrim)
-if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ]; then
+if [ $bytes -le $(_math "$fssize*512") ] && [ $FSTYP != "btrfs" ] && [ $FSTYP != "f2fs" ]; then
 	status=1
 	echo "It seems that fs logic handling len argument overflows"
 fi
-- 
2.25.4



_______________________________________________
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] 7+ messages in thread

* Re: [f2fs-dev] [PATCH v3 1/3] generic/042: make a bigger img for f2fs
  2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 1/3] generic/042: make a bigger img for f2fs Sun Ke
@ 2021-07-01 14:39   ` Chao Yu
  0 siblings, 0 replies; 7+ messages in thread
From: Chao Yu @ 2021-07-01 14:39 UTC (permalink / raw)
  To: Sun Ke, fstests; +Cc: guan, linux-f2fs-devel

On 2021/6/30 19:37, Sun Ke wrote:
> f2fs-utils 1.9.0 needs at least 38 MB space for f2fs image. However,
> f2fs-utils 1.14.0 needs at least 52 MB. Not sure if it will change again.
> So, just set it to 128M.
> 
> Suggested-by: Chao Yu <yuchao0@huawei.com>
> Signed-off-by: Sun Ke <sunke32@huawei.com>

Reviewed-by: Chao Yu <chao@kernel.org>


_______________________________________________
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] 7+ messages in thread

* Re: [f2fs-dev] [PATCH v3 2/3] generic/103: special left calculation for f2fs
  2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 2/3] generic/103: special left calculation " Sun Ke
@ 2021-07-01 14:40   ` Chao Yu
  0 siblings, 0 replies; 7+ messages in thread
From: Chao Yu @ 2021-07-01 14:40 UTC (permalink / raw)
  To: Sun Ke, fstests; +Cc: guan, linux-f2fs-devel

On 2021/6/30 19:37, Sun Ke wrote:
> It failed on f2fs:
>        QA output created by 103
>       +fallocate: No space left on device
>        Silence is golden.
>       ...
> 
> f2fs uses index(radix) tree as mapping metadata, its space overhead
> is about one thousandth of the data.
> 
> Suggested-by: Chao Yu <yuchao0@huawei.com>
> Signed-off-by: Sun Ke <sunke32@huawei.com>

Reviewed-by: Chao Yu <chao@kernel.org>


_______________________________________________
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] 7+ messages in thread

* Re: [f2fs-dev] [PATCH v3 3/3] generic/260: f2fs is also special
  2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 3/3] generic/260: f2fs is also special Sun Ke
@ 2021-07-01 14:41   ` Chao Yu
  0 siblings, 0 replies; 7+ messages in thread
From: Chao Yu @ 2021-07-01 14:41 UTC (permalink / raw)
  To: Sun Ke, fstests; +Cc: guan, linux-f2fs-devel

On 2021/6/30 19:37, Sun Ke wrote:
> It fail on f2fs:
> 
>   [+] Default length with start set (should succeed)
>   [+] Length beyond the end of fs (should succeed)
>   [+] Length beyond the end of fs with start set (should succeed)
> +After the full fs discard 0 bytes were discarded however the file system is 12882804736 bytes long.
> +It seems that fs logic handling len argument overflows
> 
> The root cause is f2fs can tag a special flag TRIMMED_FLAG to indicate
> the whole filesystem is trimmed, so after mkfs/fstrim(), following
> fstrim() won't trim any block.
> 
> Suggested-by: Chao Yu <yuchao0@huawei.com>
> Signed-off-by: Sun Ke <sunke32@huawei.com>
> ---

Reviewed-by: Chao Yu <chao@kernel.org>


_______________________________________________
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] 7+ messages in thread

end of thread, other threads:[~2021-07-01 14:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-30 11:37 [f2fs-dev] [PATCH v3 0/3] Resend the three patches Sun Ke
2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 1/3] generic/042: make a bigger img for f2fs Sun Ke
2021-07-01 14:39   ` Chao Yu
2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 2/3] generic/103: special left calculation " Sun Ke
2021-07-01 14:40   ` Chao Yu
2021-06-30 11:37 ` [f2fs-dev] [PATCH v3 3/3] generic/260: f2fs is also special Sun Ke
2021-07-01 14:41   ` Chao Yu

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).