[Ocfs2-test-devel] [PATCH 28/59] discontig_runner: fix test hanging over time issue

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


From: Jeff Liu <jeff.liu at oracle.com>

fix test hanging over time issue by breaking upon mkdir failure
which means that the test has already run out of inodes against
the test storage, and it failed to make the storage fragmented
as far as possible, so the discontig block group feature does
not take affect this time.

Signed-off-by: Jie Liu <jeff.liu at oracle.com>
Signed-off-by: Junxiao Bi <junxiao.bi at oracle.com>
---
 programs/discontig_bg_test/fillup_contig_bg.sh |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/programs/discontig_bg_test/fillup_contig_bg.sh b/programs/discontig_bg_test/fillup_contig_bg.sh
index 4a44045..dfa801f 100755
--- a/programs/discontig_bg_test/fillup_contig_bg.sh
+++ b/programs/discontig_bg_test/fillup_contig_bg.sh
@@ -256,6 +256,21 @@ function f_fillup_ebg()
 		filename=${filename_prefix}${i}
 		if [ "${i}" -gt "$OCFS2_LINK_MAX" ];then
 			mkdir -p ${WORK_PLACE}/${filename}
+			# We should not trying to make more directories
+			# if the test run out of inodes against the test
+			# file system, which means that the test failed
+			# to make the test storage fragmented this time
+			# so that the discontig block group did not took
+			# affected.  By breaking the test per mkdir failure,
+			# we can fix the test hanging issue with meaningful
+			# log information to indicate that.
+			# TODO: Figure out a better approach to make discontig
+			# block group ASAP.
+                        if [ "$?" -ne "0" ];then
+                                f_LogMsg ${LOG_FILE} "mkdir ${WORK_PLACE}/${filename} failed."
+                                break;
+                        fi
+
 			i=1
 			filename_prefix=${filename}/
 			continue
-- 
1.7.9.5




More information about the Ocfs2-test-devel mailing list