FS/XFS testing framework
 help / color / mirror / Atom feed
* [PATCH] generic/299: limit max file size
@ 2019-02-16 12:07 Yufen Yu
  2019-02-17 22:29 ` Dave Chinner
  0 siblings, 1 reply; 3+ messages in thread
From: Yufen Yu @ 2019-02-16 12:07 UTC (permalink / raw)
  To: fstests

For some filesystem, such as vfat, the max support file size
is 4G. We limit the max size and let the test go on running.

Signed-off-by: Yufen Yu <yuyufen@huawei.com>
---
 common/rc         | 13 +++++++++++++
 tests/generic/299 |  8 ++++++++
 2 files changed, 21 insertions(+)

diff --git a/common/rc b/common/rc
index d7687a64..0a8f3d07 100644
--- a/common/rc
+++ b/common/rc
@@ -3889,6 +3889,19 @@ _require_scratch_feature()
 	esac
 }
 
+_get_file_max_size()
+{
+	case $FSTYP in
+	vfat|jffs2)
+		echo $((2**32-1)) #0xffffffff
+		;;
+	*)
+		echo "0"
+		;;
+	esac
+
+}
+
 # The maximum filesystem label length, /not/ including terminating NULL
 _label_get_max()
 {
diff --git a/tests/generic/299 b/tests/generic/299
index c4d74fc8..5d462204 100755
--- a/tests/generic/299
+++ b/tests/generic/299
@@ -33,6 +33,14 @@ NUM_JOBS=$((4*LOAD_FACTOR))
 BLK_DEV_SIZE=`blockdev --getsz $SCRATCH_DEV`
 FILE_SIZE=$((BLK_DEV_SIZE * 512))
 
+# filesystem limit max file size
+max_file_size=$(_get_file_max_size)
+if [ $max_file_size -ne 0 ]
+then
+	FILE_SIZE=$([ $max_file_size -le $FILE_SIZE ] && \
+		echo "$max_file_size" || echo "$FILE_SIZE")
+fi
+
 cat >$fio_config <<EOF
 ###########
 # $seq test fio activity
-- 
2.16.2.dirty

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-18  1:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-02-16 12:07 [PATCH] generic/299: limit max file size Yufen Yu
2019-02-17 22:29 ` Dave Chinner
2019-02-18  1:51   ` yuyufen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox