fi
}
-# CMD: determine mds index where directory inode presents
-get_mds_dir () {
- local dir=$1
- local file=$dir/$tfile
-
- rm -f $file
- local iused=$(lfs df -i $dir | grep MDT | awk '{print $3}')
- local oldused=($iused)
-
- touch $file
- sleep 1
- iused=$(lfs df -i $dir | grep MDT | awk '{print $3}')
- local newused=($iused)
-
- local num=0
- for ((i=0; i<${#newused[@]}; i++)); do
- if [ ${oldused[$i]} -lt ${newused[$i]} ]; then
- echo $(( i + 1 ))
- rm -f $dir/$tfile
- return 0
- fi
- done
- error "mdt-s : inodes count OLD ${oldused[@]} NEW ${newused[@]}"
-}
-
test_21b_sub () {
local mds=$1
do_node $CLIENT1 rm -f $MOUNT1/$tfile-*
run_test 57a "verify MDS filesystem created with large inodes =="
test_57b() {
- FILECOUNT=100
- FILE1=$DIR/d57b/f1
- FILEN=$DIR/d57b/f$FILECOUNT
- rm -rf $DIR/d57b || error "removing $DIR/d57b"
- mkdir -p $DIR/d57b || error "creating $DIR/d57b"
+ local dir=$DIR/d57b
+
+ local FILECOUNT=100
+ local FILE1=$dir/f1
+ local FILEN=$dir/f$FILECOUNT
+
+ rm -rf $dir || error "removing $dir"
+ mkdir -p $dir || error "creating $dir"
+ local num=$(get_mds_dir $dir)
+ local mymds=mds$num
+
echo "mcreating $FILECOUNT files"
- createmany -m $DIR/d57b/f 1 $FILECOUNT || \
- error "creating files in $DIR/d57b"
+ createmany -m $dir/f 1 $FILECOUNT || \
+ error "creating files in $dir"
# verify that files do not have EAs yet
$GETSTRIPE $FILE1 2>&1 | grep -q "no stripe" || error "$FILE1 has an EA"
$GETSTRIPE $FILEN 2>&1 | grep -q "no stripe" || error "$FILEN has an EA"
- MDSFREE="`lctl get_param -n osd.*MDT0000.kbytesfree 2> /dev/null`"
- MDCFREE="`lctl get_param -n mdc.*.kbytesfree | head -n 1`"
+ local MDSFREE=$(do_facet $mymds lctl get_param -n osd.*MDT000$((num -1)).kbytesfree)
+ local MDCFREE=$(lctl get_param -n mdc.*.kbytesfree | head -n 1)
echo "opening files to create objects/EAs"
- for FILE in `seq -f $DIR/d57b/f%g 1 $FILECOUNT`; do
+ local FILE
+ for FILE in `seq -f $dir/f%g 1 $FILECOUNT`; do
$OPENFILE -f O_RDWR $FILE > /dev/null || error "opening $FILE"
done
$GETSTRIPE $FILE1 | grep -q "obdidx" || error "$FILE1 missing EA"
$GETSTRIPE $FILEN | grep -q "obdidx" || error "$FILEN missing EA"
- sleep 1 # make sure we get new statfs data
-# MDSFREE2="`lctl get_param -n mds.*.kbytesfree`"
-# MDCFREE2="`lctl get_param -n mdc.*.kbytesfree`"
+# sleep 1 # make sure we get new statfs data
+# local MDSFREE2=$(do_facet $mymds lctl get_param -n osd.*MDT000$((num -1)).kbytesfree)
+# local MDCFREE2=$(lctl get_param -n mdc.*.kbytesfree)
# if [ "$MDCFREE2" -lt "$((MDCFREE - 8))" ]; then
# if [ "$MDSFREE" != "$MDSFREE2" ]; then
# error "MDC before $MDCFREE != after $MDCFREE2"
# echo "unable to confirm if MDS has large inodes"
# fi
# fi
- rm -rf $DIR/d57b
+ rm -rf $dir
}
run_test 57b "default LOV EAs are stored inside large inodes ==="
rm -f $tmp_file
}
+# CMD: determine mds index where directory inode presents
+get_mds_dir () {
+ local dir=$1
+ local file=$dir/$tfile
+
+ rm -f $file
+ local iused=$(lfs df -i $dir | grep MDT | awk '{print $3}')
+ local oldused=($iused)
+
+ touch $file
+ sleep 1
+ iused=$(lfs df -i $dir | grep MDT | awk '{print $3}')
+ local newused=($iused)
+
+ local num=0
+ for ((i=0; i<${#newused[@]}; i++)); do
+ if [ ${oldused[$i]} -lt ${newused[$i]} ]; then
+ echo $(( i + 1 ))
+ rm -f $dir/$tfile
+ return 0
+ fi
+ done
+ error "mdt-s : inodes count OLD ${oldused[@]} NEW ${newused[@]}"
+}
+
mpi_run () {
local mpirun="$MPIRUN $MPIRUN_OPTIONS"
local command="$mpirun $@"