+test_127() { # bug 15521
+ $LSTRIPE -i 0 -c 1 $DIR/$tfile
+ $LCTL set_param osc.*.stats=0
+ FSIZE=$((2048 * 1024))
+ dd if=/dev/zero of=$DIR/$tfile bs=$FSIZE count=1
+ cancel_lru_locks osc
+ dd if=$DIR/$tfile of=/dev/null bs=$FSIZE
+
+ $LCTL get_param osc.*0000-osc-*.stats | grep samples > $DIR/${tfile}.tmp
+ while read NAME COUNT SAMP UNIT MIN MAX SUM SUMSQ; do
+ eval $NAME=$COUNT
+ echo "got $COUNT $NAME"
+
+ case $NAME in
+ ost_read|ost_write)
+ [ $MIN -lt 4096 ] && error "min is too small: $MIN"
+ [ $MIN -gt $FSIZE ] && error "min is too big: $MIN"
+ [ $MAX -lt 4096 ] && error "max is too small: $MAX"
+ [ $MAX -gt $FSIZE ] && error "max is too big: $MAX"
+ [ $SUM -ne $FSIZE ] && error "sum is wrong: $SUM"
+ [ $SUMSQ -lt $(((FSIZE /4096) * (4096 * 4096))) ] &&
+ error "sumsquare is too small: $SUMSQ"
+ [ $SUMSQ -gt $((FSIZE * FSIZE)) ] &&
+ error "sumsquare is too big: $SUMSQ"
+ ;;
+ *) ;;
+ esac
+ done < $DIR/${tfile}.tmp
+
+ #check that we actually got some stats
+ [ "$ost_read" ] || error "no read done"
+ [ "$ost_write" ] || error "no write done"
+}
+run_test 127 "verify the client stats are sane"
+
+test_128() { # bug 15212
+ touch $DIR/$tfile
+ $LFS 2>&1 <<-EOF | tee $TMP/$tfile.log
+ find $DIR/$tfile
+ find $DIR/$tfile
+ EOF
+
+ result=$(grep error $TMP/$tfile.log)
+ rm -f $DIR/$tfile
+ [ -z "$result" ] || error "consecutive find's under interactive lfs failed"
+}
+run_test 128 "interactive lfs for 2 consecutive find's"
+
+test_129() {
+ [ "$FSTYPE" != "ldiskfs" ] && skip "not needed for FSTYPE=$FSTYPE" && return 0
+
+ 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
+
+ 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 ========================"
+
+