[Ocfs2-test-devel] [PATCH 50/59] discontig-test: fix punch hole

Junxiao Bi junxiao.bi at oracle.com
Sun Sep 13 19:44:36 PDT 2015


Punch hole test needs reserve some extents block but it run
when fs is full of fragements and no enough space, and this
cause block group allocation fail. Remove some files with xattr
and try again.

Signed-off-by: Junxiao Bi <junxiao.bi at oracle.com>
---
 programs/discontig_bg_test/discontig_runner.sh |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/programs/discontig_bg_test/discontig_runner.sh b/programs/discontig_bg_test/discontig_runner.sh
index 0f389a4..a88f83a 100755
--- a/programs/discontig_bg_test/discontig_runner.sh
+++ b/programs/discontig_bg_test/discontig_runner.sh
@@ -485,6 +485,7 @@ function f_extents_test()
 
 	#use punch_hole to change extent_list then to update
 	f_LogMsg ${LOG_FILE} "Update extent blocks by punching holes"
+	rm_start=1
 	offset=0
 	num=0
 	count=$((${filesize}/${CLUSTERSIZE}))
@@ -496,8 +497,16 @@ function f_extents_test()
 	while :;do
 		if [ "$((${RANDOM}%2))" -eq "0" ];then
 			${PUNCH_HOLE_BIN} -f ${filename} -s ${offset} -l ${CLUSTERSIZE} >>/dev/null 2>&1 || {
-				f_LogMsg ${LOG_FILE} "Punch hole at offset:${offset} failed."
-				return 1
+				if [ $rm_start -ne 10 ]; then
+					f_LogMsg ${LOG_FILE} "Punch hole at offset:${offset} failed, rm addup-${rm_start} and try again."
+					rm -rf ${WORK_PLACE}/extents_testfile_xattr_addup-${rm_start}*
+					sync
+					rm_start=$(($rm_start+1))
+					continue
+				else
+					f_LogMsg ${LOG_FILE} "Punch hole at offset:${offset} failed."
+					return 1
+				fi
 			}
 		fi
 		num=$((${num}+${inc}))
-- 
1.7.9.5




More information about the Ocfs2-test-devel mailing list