summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorAndrey Albershteyn <aalbersh@redhat.com>2023-09-11 22:06:17 +0200
committerZorro Lang <zlang@kernel.org>2023-09-20 15:49:54 +0800
commit566fc79138eff6bc4bda5d63962bbcb1e366e684 (patch)
treeb8e8b4c48abf00d602d213380b7eaec7a9989154 /common
parentf738aca836ad4f6b96673831f28613d8105b5fba (diff)
common/rc: make _get_max_file_size find file size on mount point
Currently, _get_max_file_size finds max file size on $TEST_DIR. The tests/generic/692 uses this function to detect file size and then tries to create a file on $SCRATCH_MNT. This works fine when test and scratch filesystems have the same block size. However, it will fail if they differ. Make _get_max_file_size accept mount point on which to detect max file size. Signed-off-by: Andrey Albershteyn <aalbersh@redhat.com> Reviewed-by: "Darrick J. Wong" <djwong@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
Diffstat (limited to 'common')
-rw-r--r--common/rc8
1 files changed, 7 insertions, 1 deletions
diff --git a/common/rc b/common/rc
index a438a8de..76a7e774 100644
--- a/common/rc
+++ b/common/rc
@@ -4828,7 +4828,13 @@ _require_scratch_feature()
# be UINT32_MAX * block_size, but other filesystems may allow up to LLONG_MAX.
_get_max_file_size()
{
- local testfile=$TEST_DIR/maxfilesize.$seq
+ if [ -z $1 ] || [ ! -d $1 ]; then
+ echo "Missing mount point argument for _get_max_file_size"
+ exit 1
+ fi
+
+ local mnt=$1
+ local testfile=$mnt/maxfilesize.$seq
local l=0
local r=9223372036854775807 # LLONG_MAX