done
ost_indices=$(comma_list $ost_indices)
- trap "restore_ostindex" EXIT
+ stack_trap "restore_ostindex" EXIT
echo -e "\nFormat $OSTCOUNT OSTs with sparse indices $ost_indices"
OST_INDEX_LIST=[$ost_indices] formatall
error "start ost$i failed"
done
+ # Collect debug information - start of test
+ do_nodes $(comma_list $(mdts_nodes)) \
+ $LCTL get_param osc.*.prealloc_*_id
+
mount_client $MOUNT || error "mount client $MOUNT failed"
wait_osts_up
$LFS df $MOUNT || error "$LFS df $MOUNT failed"
mkdir $DIR/$tdir || error "mkdir $DIR/$tdir failed"
+ stack_trap "do_nodes $(comma_list $(mdts_nodes)) \
+ $LCTL get_param osc.*.prealloc_*_id" EXIT
+
# 1. If the file does not exist, new file will be created
# with specified OSTs.
local file=$DIR/$tdir/$tfile-1
[[ -z "$file" || -z "$expected" ]] &&
error "check_stripe_count: invalid argument"
- local cmd="$GETSTRIPE -c $file"
+ local cmd="$LFS getstripe -c $file"
actual=$($cmd) || error "$cmd failed"
actual=${actual%% *}
if [[ $actual -ne $expected ]]; then
- [[ $expected -eq -1 ]] ||
- error "$cmd wrong: found $actual, expected $expected"
- [[ $actual -eq $OSTCOUNT ]] ||
- error "$cmd wrong: found $actual, expected $OSTCOUNT"
+ [[ $expected -eq -1 ]] || { $LFS getstripe $file;
+ error "$cmd not expected ($expected): found $actual"; }
+ [[ $actual -eq $OSTCOUNT ]] || { $LFS getstripe $file;
+ error "$cmd not OST count ($OSTCOUNT): found $actual"; }
fi
}