declare -a ost_idx
local index
+ local found
local i
local j
ost_idx=($($GETSTRIPE $tfile$i |
tail -n $((OSTCOUNT + 1)) | awk '{print $1}'))
echo ${ost_idx[@]}
+
# check the layout
- for j in $(seq 0 $((OSTCOUNT - 1))); do
- index=$(((i + j) % OSTCOUNT))
- [ ${ost_idx[$j]} -eq $index ] ||
- error "$j:${ost_idx[$j]} != $index"
+ [ ${#ost_idx[@]} -eq $OSTCOUNT ] ||
+ error "${#ost_idx[@]} != $OSTCOUNT"
+
+ for index in $(seq 0 $((OSTCOUNT - 1))); do
+ found=0
+ for j in $(echo ${ost_idx[@]}); do
+ if [ $index -eq $j ]; then
+ found=1
+ break
+ fi
+ done
+ [ $found = 1 ] ||
+ error "Can not find $index in ${ost_idx[@]}"
done
done
}
for ostnum in $(seq $OSTCOUNT); do
# test-framework's OST numbering is one-based, while Lustre's
# is zero-based
- ostname=$(printf "$FSNAME-OST%.4d" $((ostnum - 1)))
+ ostname=$(printf "$FSNAME-OST%.4x" $((ostnum - 1)))
# Parsing llobdstat's output sucks; we could grep the /proc
# path, but that's likely to not be as portable as using the
# llobdstat utility. So we parse lctl output instead.
# Total up write_bytes after writing. We'd better find non-zeros.
for ostnum in $(seq $OSTCOUNT); do
- ostname=$(printf "$FSNAME-OST%.4d" $((ostnum - 1)))
+ ostname=$(printf "$FSNAME-OST%.4x" $((ostnum - 1)))
write_bytes=$(do_facet ost$ostnum lctl get_param -n \
obdfilter/$ostname/stats |
awk '/^write_bytes/ {print $7}' )
if $all_zeros
then
for ostnum in $(seq $OSTCOUNT); do
- ostname=$(printf "$FSNAME-OST%.4d" $((ostnum - 1)))
+ ostname=$(printf "$FSNAME-OST%.4x" $((ostnum - 1)))
echo "Check that write_bytes is present in obdfilter/*/stats:"
do_facet ost$ostnum lctl get_param -n \
obdfilter/$ostname/stats
}
run_test 184c "Concurrent write and layout swap"
+test_184d() {
+ check_swap_layouts_support && return 0
+
+ local file1=$DIR/$tdir/$tfile-1
+ local file2=$DIR/$tdir/$tfile-2
+ local file3=$DIR/$tdir/$tfile-3
+ local lovea1
+ local lovea2
+
+ mkdir -p $DIR/$tdir
+ touch $file1 || error "create $file1 failed"
+ $OPENFILE -f O_CREAT:O_LOV_DELAY_CREATE $file2 ||
+ error "create $file2 failed"
+ $OPENFILE -f O_CREAT:O_LOV_DELAY_CREATE $file3 ||
+ error "create $file3 failed"
+ lovea1=$($LFS getstripe $file1 | sed 1d)
+
+ $LFS swap_layouts $file2 $file3 ||
+ error "swap $file2 $file3 layouts failed"
+ $LFS swap_layouts $file1 $file2 ||
+ error "swap $file1 $file2 layouts failed"
+
+ lovea2=$($LFS getstripe $file2 | sed 1d)
+ [ "$lovea1" == "$lovea2" ] || error "lovea $lovea1 != $lovea2"
+
+ lovea1=$(getfattr -n trusted.lov $file1 | grep ^trusted)
+ [ -z $lovea1 ] || error "$file1 shouldn't have lovea"
+}
+run_test 184d "allow stripeless layouts swap"
+
+
test_185() { # LU-2441
mkdir -p $DIR/$tdir || error "creating dir $DIR/$tdir"
touch $DIR/$tdir/spoo
test_216() { # bug 20317
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- remote_ost_nodsh && skip "remote OST with nodsh" && return
- local node
- local p="$TMP/sanityN-$TESTNAME.parameters"
- save_lustre_params $HOSTNAME "osc.*.contention_seconds" > $p
- for node in $(osts_nodes); do
- save_lustre_params $node "ldlm.namespaces.filter-*.max_nolock_bytes" >> $p
- save_lustre_params $node "ldlm.namespaces.filter-*.contended_locks" >> $p
- save_lustre_params $node "ldlm.namespaces.filter-*.contention_seconds" >> $p
- done
- clear_osc_stats
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
+
+ local node
+ local facets=$(get_facets OST)
+ local p="$TMP/$TESTSUITE-$TESTNAME.parameters"
+
+ save_lustre_params client "osc.*.contention_seconds" > $p
+ save_lustre_params $facets \
+ "ldlm.namespaces.filter-*.max_nolock_bytes" >> $p
+ save_lustre_params $facets \
+ "ldlm.namespaces.filter-*.contended_locks" >> $p
+ save_lustre_params $facets \
+ "ldlm.namespaces.filter-*.contention_seconds" >> $p
+ clear_osc_stats
# agressive lockless i/o settings
for node in $(osts_nodes); do