From: Sun Ke Date: Wed, 30 Jun 2021 11:37:35 +0000 (+0800) Subject: generic/103: special left calculation for f2fs X-Git-Tag: v2022.05.01~354 X-Git-Url: http://git.apps.os.sepia.ceph.com/?p=xfstests-dev.git;a=commitdiff_plain;h=9e31513f5fbd03a997b43197bbe594ae9a1da103 generic/103: special left calculation for f2fs 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 Signed-off-by: Sun Ke Reviewed-by: Chao Yu Signed-off-by: Eryu Guan --- diff --git a/tests/generic/103 b/tests/generic/103 index 795f851d..4efa1dc3 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 }