From: Sun Ke <sunke32@huawei.com>
To: <fstests@vger.kernel.org>,
<linux-f2fs-devel@lists.sourceforge.net>, <guan@eryu.me>,
<chao@kernel.org>
Cc: <sunke32@huawei.com>
Subject: [PATCH v3 3/3] generic/260: f2fs is also special
Date: Wed, 30 Jun 2021 19:37:36 +0800 [thread overview]
Message-ID: <20210630113736.551843-4-sunke32@huawei.com> (raw)
In-Reply-To: <20210630113736.551843-1-sunke32@huawei.com>
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
next prev parent reply other threads:[~2021-06-30 11:31 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-30 11:37 [PATCH v3 0/3] Resend the three patches Sun Ke
2021-06-30 11:37 ` [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 ` [PATCH v3 2/3] generic/103: special left calculation " Sun Ke
2021-07-01 14:40 ` Chao Yu
2021-06-30 11:37 ` Sun Ke [this message]
2021-07-01 14:41 ` [PATCH v3 3/3] generic/260: f2fs is also special Chao Yu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210630113736.551843-4-sunke32@huawei.com \
--to=sunke32@huawei.com \
--cc=chao@kernel.org \
--cc=fstests@vger.kernel.org \
--cc=guan@eryu.me \
--cc=linux-f2fs-devel@lists.sourceforge.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox