From: bwzhou Date: Fri, 27 Jun 2008 03:26:27 +0000 (+0000) Subject: Branch HEAD X-Git-Tag: v1_9_50~319 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=8dcf444f507f3dd7786ba940100419d476963d31;hp=5f55799d7941e7a209846f7c37b799251a276448 Branch HEAD b=15881 r=rread rewrite sanity 129 --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 981fba9..63506ad 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -5100,42 +5100,41 @@ test_128() { # bug 15212 run_test 128 "interactive lfs for 2 consecutive find's" test_129() { - [ "$FSTYPE" = "ldiskfs" ] || return 0 - mkdir $DIR/$tdir - - EFBIG=27 - ldiskfs_prefix=/proc/fs/ldiskfs - proc_file=max_dir_size - max_bytes=16385 - - echo $max_bytes >$ldiskfs_prefix/$proc_file - - I=0 - J=0 - while [ $I -lt $max_bytes ]; do - touch $DIR/$tdir/$J - J=$((J+1)) - I=$(stat -c%s "$DIR/$tdir") - done + [ "$FSTYPE" != "ldiskfs" ] && skip "not needed for FSTYPE=$FSTYPE" && return 0 - # One more file and we should be over the limit - multiop $DIR/$tdir/$J Oc - rc=$? - if [ $rc -eq 0 ]; then - rm -rf $DIR/$tdir - error "exceeded dir size limit: $I bytes" - elif [ $rc -ne $EFBIG ]; then - rm -rf $DIR/$tdir - error "return code $rc received instead of expected $EFBIG" - else - echo "return code $rc received as expected" - fi + DEV=$(basename $(do_facet mds lctl get_param -n osd.*MDT*.mntdev)) + [ -z "$DEV" ] && error "can't access mds mntdev" + EFBIG=27 + LDPROC=/proc/fs/ldiskfs/$DEV/max_dir_size + MAX=16384 - echo 0 >$ldiskfs_prefix/$proc_file - rm -rf $DIR/$tdir + do_facet mds "echo $MAX > $LDPROC" + + mkdir -p $DIR/$tdir + + I=0 + J=0 + while [ ! $I -gt $MAX ]; do + multiop $DIR/$tdir/$J Oc + rc=$? + if [ $rc -eq $EFBIG ]; then + do_facet mds "echo 0 >$LDPROC" + echo "return code $rc received as expected" + return 0 + elif [ $rc -ne 0 ]; then + do_facet mds "echo 0 >$LDPROC" + error_exit "return code $rc received instead of expected $EFBIG" + fi + J=$((J+1)) + I=$(stat -c%s "$DIR/$tdir") + done + + error "exceeded dir size limit: $I bytes" + do_facet mds "echo 0 >$LDPROC" } run_test 129 "test directory size limit ========================" + TMPDIR=$OLDTMPDIR TMP=$OLDTMP HOME=$OLDHOME