From 441b601aa5a337e5637a24f237ecb5029f05b64c Mon Sep 17 00:00:00 2001
From: shadow <shadow>
Date: Thu, 22 Feb 2007 18:34:56 +0000
Subject: [PATCH] fix run test large amount free memory. r=adilger

---
 lustre/tests/sanity.sh | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh
index 7ec420ccaf..03ec592059 100644
--- a/lustre/tests/sanity.sh
+++ b/lustre/tests/sanity.sh
@@ -3061,9 +3061,11 @@ rm -f $F77_TMP
 unset F77_TMP
 
 test_78() { # bug 10901
-	MEMFREE=$(($(awk '/MemFree:/ { print $2 }' /proc/meminfo) / 1024))
-	[ $MEMFREE -gt 512 ] && MEMFREE=512
-	$DIRECTIO rdwr $DIR/$tfile 0 $MEMFREE 1048576
+	F78SIZE=$(($(awk '/MemFree:/ { print $2 }' /proc/meminfo) / 1024))
+	[ $F78SIZE -gt 512 ] && F78SIZE=512
+	[ $F78SIZE -gt $((MAXFREE / 1024)) ] && F78SIZE=$((MAXFREE / 1024))
+	$SETSTRIPE $DIR/$tfile 0 -1 -1
+	$DIRECTIO rdwr $DIR/$tfile 0 $F78SIZE 1048576
 }
 run_test 78 "handle large O_DIRECT writes correctly ============"
 
-- 
GitLab