Some of the information only prints in sanity/116a don't account for a
0 in the minimum number and thus divide by zero, but only print if MIN
is above zero, so this just doesn't do the calculation if it isn't
needed.
Signed-off-by: Nathaniel Clark <nathaniel.l.clark@intel.com>
Change-Id: I7003739f6b518f981a1058d41b19bca258e1d11e
Reviewed-on: http://review.whamcloud.com/19359
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
echo "Wrote ${DIFF}KB to smaller OST $MINI1"
DIFF2=$(($MAXV1 - ${AVAIL[$MAXI1]}))
echo "Wrote ${DIFF2}KB to larger OST $MAXI1"
echo "Wrote ${DIFF}KB to smaller OST $MINI1"
DIFF2=$(($MAXV1 - ${AVAIL[$MAXI1]}))
echo "Wrote ${DIFF2}KB to larger OST $MAXI1"
- FILL=$(($DIFF2 * 100 / $DIFF - 100))
- [ $DIFF -gt 0 ] &&
+ if [[ $DIFF -gt 0 ]]; then
+ FILL=$(($DIFF2 * 100 / $DIFF - 100))
echo "Wrote ${FILL}% more data to larger OST $MAXI1"
echo "Wrote ${FILL}% more data to larger OST $MAXI1"
# Figure out which files were written where
UUID=$(lctl get_param -n lov.${FSNAME}-clilov-*.target_obd |
# Figure out which files were written where
UUID=$(lctl get_param -n lov.${FSNAME}-clilov-*.target_obd |
echo $UUID
MAXC=$($GETSTRIPE --ost $UUID $DIR/$tdir | grep $DIR | wc -l)
echo "$MAXC files created on larger OST $MAXI1"
echo $UUID
MAXC=$($GETSTRIPE --ost $UUID $DIR/$tdir | grep $DIR | wc -l)
echo "$MAXC files created on larger OST $MAXI1"
- FILL=$(($MAXC * 100 / $MINC - 100))
- [[ $MINC -gt 0 ]] &&
+ if [[ $MINC -gt 0 ]]; then
+ FILL=$(($MAXC * 100 / $MINC - 100))
echo "Wrote ${FILL}% more files to larger OST $MAXI1"
echo "Wrote ${FILL}% more files to larger OST $MAXI1"
[[ $MAXC -gt $MINC ]] ||
error_ignore LU-9 "stripe QOS didn't balance free space"
simple_cleanup_common
[[ $MAXC -gt $MINC ]] ||
error_ignore LU-9 "stripe QOS didn't balance free space"
simple_cleanup_common