From: Peng Tao Date: Mon, 24 Sep 2012 07:17:41 +0000 (+0800) Subject: LU-2020 sanity: test 140 should allow 40 consecutive symlink X-Git-Tag: 2.3.55~27 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=ec9dc9e57cea7d2d750d8db1332ea6993f52028f LU-2020 sanity: test 140 should allow 40 consecutive symlink For kernel > 3.5, to test recursive symlink, we need real recursive symlink. Signed-off-by: Peng Tao Change-Id: I4f1b834a79cdf4edb1775da45200f6fd2a680709 Reviewed-on: http://review.whamcloud.com/4079 Tested-by: Hudson Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Keith Mannthey --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 789f3af..4675399 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -7790,8 +7790,9 @@ test_140() { #bug-17379 cd $DIR/$tdir || error "Changing to $DIR/$tdir" cp /usr/bin/stat . || error "Copying stat to $DIR/$tdir" - # VFS limits max symlink depth to 5(4KSTACK) or 7(8KSTACK) or 8 - local i=0 + # VFS limits max symlink depth to 5(4KSTACK) or 7(8KSTACK) or 8 + # For kernel > 3.5, bellow only tests consecutive symlink (MAX 40) + local i=0 while i=`expr $i + 1`; do mkdir -p $i || error "Creating dir $i" cd $i || error "Changing to $i" @@ -7811,7 +7812,14 @@ test_140() { #bug-17379 done i=`expr $i - 1` echo "The symlink depth = $i" - [ $i -eq 5 -o $i -eq 7 -o $i -eq 8 ] || error "Invalid symlink depth" + [ $i -eq 5 -o $i -eq 7 -o $i -eq 8 -o $i -eq 40 ] || + error "Invalid symlink depth" + + # Test recursive symlink + ln -s symlink_self symlink_self + $OPENFILE -f O_RDONLY symlink_self >/dev/null 2>&1; ret=$? + echo "open symlink_self returns $ret" + [ $ret -eq 40 ] || error "recursive symlink doesn't return -ELOOP" } run_test 140 "Check reasonable stack depth (shouldn't LBUG) ===="