diff mbox series

[v3,2/3] generic/103: special left calculation for f2fs

Message ID 20210630113736.551843-3-sunke32@huawei.com (mailing list archive)
State New, archived
Headers show
Series Resend the three patches | expand

Commit Message

Sun Ke June 30, 2021, 11:37 a.m. UTC
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(-)

Comments

Chao Yu July 1, 2021, 2:40 p.m. UTC | #1
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>
diff mbox series

Patch

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
 }