if [[ $(uname -m) = aarch64 ]]; then
# bug number: LU-11596
ALWAYS_EXCEPT+=" $GRANT_CHECK_LIST"
- # bug number: LU-11671 LU-11667 LU-11729 LU-4398
- ALWAYS_EXCEPT+=" 45 317 810 817"
+ # bug number: LU-11671 LU-11667 LU-4398
+ ALWAYS_EXCEPT+=" 45 317 817"
fi
# 5 12 (min)"
[ "$SLOW" = "no" ] && EXCEPT_SLOW="27m 64b 68 71 115 300o"
if [ "$mds1_FSTYPE" = "zfs" ]; then
- # bug number for skipped test: LU-1957
- ALWAYS_EXCEPT="$ALWAYS_EXCEPT 180"
+ # bug number for skipped test:
+ ALWAYS_EXCEPT="$ALWAYS_EXCEPT "
# 13 (min)"
[ "$SLOW" = "no" ] && EXCEPT_SLOW="$EXCEPT_SLOW 51b"
fi
}
run_test 27L "lfs pool_list gives correct pool name"
+test_27M() {
+ [[ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.12.57) ]] &&
+ skip "Need MDS version >= than 2.12.57"
+ remote_mds_nodsh && skip "remote MDS with nodsh"
+ [[ $OSTCOUNT -lt 2 ]] && skip_env "need > 1 OST"
+
+ test_mkdir $DIR/$tdir
+
+ # Set default striping on directory
+ $LFS setstripe -C 4 $DIR/$tdir
+
+ echo 1 > $DIR/$tdir/${tfile}.1
+ local count=$($LFS getstripe -c $DIR/$tdir/${tfile}.1)
+ local setcount=4
+ [ $count -eq $setcount ] ||
+ error "(1) stripe count $count, should be $setcount"
+
+ # Capture existing append_stripe_count setting for restore
+ local orig_count=$(do_facet mds1 $LCTL get_param -n mdd.$FSNAME-MDT0000.append_stripe_count)
+ local mdts=$(comma_list $(mdts_nodes))
+ stack_trap "do_nodes $mdts $LCTL set_param mdd.*.append_stripe_count=$orig_count" EXIT
+
+ local appendcount=$orig_count
+ echo 1 >> $DIR/$tdir/${tfile}.2_append
+ count=$($LFS getstripe -c $DIR/$tdir/${tfile}.2_append)
+ [ $count -eq $appendcount ] ||
+ error "(2)stripe count $count, should be $appendcount for append"
+
+ # Disable O_APPEND striping, verify it works
+ do_nodes $mdts $LCTL set_param mdd.*.append_stripe_count=0
+
+ # Should now get the default striping, which is 4
+ setcount=4
+ echo 1 >> $DIR/$tdir/${tfile}.3_append
+ count=$($LFS getstripe -c $DIR/$tdir/${tfile}.3_append)
+ [ $count -eq $setcount ] ||
+ error "(3) stripe count $count, should be $setcount"
+
+ # Try changing the stripe count for append files
+ do_nodes $mdts $LCTL set_param mdd.*.append_stripe_count=2
+
+ # Append striping is now 2 (directory default is still 4)
+ appendcount=2
+ echo 1 >> $DIR/$tdir/${tfile}.4_append
+ count=$($LFS getstripe -c $DIR/$tdir/${tfile}.4_append)
+ [ $count -eq $appendcount ] ||
+ error "(4) stripe count $count, should be $appendcount for append"
+
+ # Test append stripe count of -1
+ do_nodes $mdts $LCTL set_param mdd.*.append_stripe_count=-1
+ appendcount=$OSTCOUNT
+ echo 1 >> $DIR/$tdir/${tfile}.5
+ count=$($LFS getstripe -c $DIR/$tdir/${tfile}.5)
+ [ $count -eq $appendcount ] ||
+ error "(5) stripe count $count, should be $appendcount for append"
+
+ # Set append striping back to default of 1
+ do_nodes $mdts $LCTL set_param mdd.*.append_stripe_count=1
+
+ # Try a new default striping, PFL + DOM
+ $LFS setstripe -L mdt -E 1M -E -1 -c 2 $DIR/$tdir
+
+ # Create normal DOM file, DOM returns stripe count == 0
+ setcount=0
+ touch $DIR/$tdir/${tfile}.6
+ count=$($LFS getstripe -c $DIR/$tdir/${tfile}.6)
+ [ $count -eq $setcount ] ||
+ error "(6) stripe count $count, should be $setcount"
+
+ # Show
+ appendcount=1
+ echo 1 >> $DIR/$tdir/${tfile}.7_append
+ count=$($LFS getstripe -c $DIR/$tdir/${tfile}.7_append)
+ [ $count -eq $appendcount ] ||
+ error "(7) stripe count $count, should be $appendcount for append"
+
+ # Clean up DOM layout
+ $LFS setstripe -d $DIR/$tdir
+
+ # Now test that append striping works when layout is from root
+ $LFS setstripe -c 2 $MOUNT
+ # Make a special directory for this
+ mkdir $DIR/${tdir}/${tdir}.2
+ stack_trap "$LFS setstripe -d $MOUNT" EXIT
+
+ # Verify for normal file
+ setcount=2
+ echo 1 > $DIR/${tdir}/${tdir}.2/${tfile}.8
+ count=$($LFS getstripe -c $DIR/$tdir/${tdir}.2/${tfile}.8)
+ [ $count -eq $setcount ] ||
+ error "(8) stripe count $count, should be $setcount"
+
+ appendcount=1
+ echo 1 >> $DIR/${tdir}/${tdir}.2/${tfile}.9_append
+ count=$($LFS getstripe -c $DIR/${tdir}/${tdir}.2/${tfile}.9_append)
+ [ $count -eq $appendcount ] ||
+ error "(9) stripe count $count, should be $appendcount for append"
+
+ # Now test O_APPEND striping with pools
+ do_nodes $mdts $LCTL set_param mdd.*.append_pool="$TESTNAME"
+ stack_trap "do_nodes $mdts $LCTL set_param mdd.*.append_pool='none'" EXIT
+
+ # Create the pool
+ pool_add $TESTNAME || error "pool creation failed"
+ pool_add_targets $TESTNAME 0 1 || error "Pool add targets failed"
+
+ echo 1 >> $DIR/$tdir/${tfile}.10_append
+
+ pool=$($LFS getstripe -p $DIR/$tdir/${tfile}.10_append)
+ [ "$pool" = "$TESTNAME" ] || error "(10) incorrect pool: $pool"
+
+ # Check that count is still correct
+ appendcount=1
+ echo 1 >> $DIR/$tdir/${tfile}.11_append
+ count=$($LFS getstripe -c $DIR/$tdir/${tfile}.11_append)
+ [ $count -eq $appendcount ] ||
+ error "(11) stripe count $count, should be $appendcount for append"
+
+ # Disable O_APPEND stripe count, verify pool works separately
+ do_nodes $mdts $LCTL set_param mdd.*.append_stripe_count=0
+
+ echo 1 >> $DIR/$tdir/${tfile}.12_append
+
+ pool=$($LFS getstripe -p $DIR/$tdir/${tfile}.12_append)
+ [ "$pool" = "$TESTNAME" ] || error "(12) incorrect pool: $pool"
+
+ # Remove pool setting, verify it's not applied
+ do_nodes $mdts $LCTL set_param mdd.*.append_pool='none'
+
+ echo 1 >> $DIR/$tdir/${tfile}.13_append
+
+ pool=$($LFS getstripe -p $DIR/$tdir/${tfile}.13_append)
+ [ "$pool" = "" ] || error "(13) pool found: $pool"
+}
+run_test 27M "test O_APPEND striping"
+
# createtest also checks that device nodes are created and
# then visible correctly (#2091)
test_28() { # bug 2091
test_255c() {
[ $OST1_VERSION -lt $(version_code 2.10.50) ] &&
- skip "lustre < 2.10.53 does not support lockahead"
+ skip "lustre < 2.10.50 does not support lockahead"
local count
local new_count
}
test_802a() {
-
+ [[ $mds1_FSTYPE = zfs ]] || skip "ZFS specific test"
[[ $(lustre_version_code mds1) -lt $(version_code 2.9.55) ]] ||
[[ $OST1_VERSION -lt $(version_code 2.9.55) ]] &&
skip "Need server version at least 2.9.55"
run_test 809 "Verify no SOM xattr store for DoM-only files"
test_810() {
- local ORIG
- local CSUM
-
- # t10 seem to dislike partial pages
- lctl set_param osc.*.checksum_type=adler
- lctl set_param fail_loc=0x411
- dd if=/dev/urandom of=$DIR/$tfile bs=10240 count=2
- ORIG=$(md5sum $DIR/$tfile)
- lctl set_param ldlm.namespaces.*osc*.lru_size=clear
- CSUM=$(md5sum $DIR/$tfile)
- set_checksum_type adler
- if [ "$ORIG" != "$CSUM" ]; then
- error "$ORIG != $CSUM"
- fi
+ [ $PARALLEL == "yes" ] && skip "skip parallel run"
+ $GSS && skip_env "could not run with gss"
+
+ set_checksums 1
+ stack_trap "set_checksums $ORIG_CSUM" EXIT
+ stack_trap "set_checksum_type $ORIG_CSUM_TYPE" EXIT
+
+ local csum
+ local before
+ local after
+ for csum in $CKSUM_TYPES; do
+ #define OBD_FAIL_OSC_NO_GRANT 0x411
+ $LCTL set_param osc.*.checksum_type=$csum fail_loc=0x411
+ for i in "10240 0" "10000 0" "4000 1" "500 1"; do
+ eval set -- $i
+ dd if=/dev/urandom of=$DIR/$tfile bs=$1 count=2 seek=$2
+ before=$(md5sum $DIR/$tfile)
+ $LCTL set_param ldlm.namespaces.*osc*.lru_size=clear
+ after=$(md5sum $DIR/$tfile)
+ [ "$before" == "$after" ] ||
+ error "$csum: $before != $after bs=$1 seek=$2"
+ done
+ done
}
run_test 810 "partial page writes on ZFS (LU-11663)"