set -e
ONLY=${ONLY:-"$*"}
+
+LUSTRE=${LUSTRE:-$(dirname $0)/..}
+. $LUSTRE/tests/test-framework.sh
+init_test_env $@
+init_logging
+
ALWAYS_EXCEPT="$SANITY_SCRUB_EXCEPT"
[ "$SLOW" = "no" ] && EXCEPT_SLOW=""
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-LUSTRE=${LUSTRE:-$(cd $(dirname $0)/..; echo $PWD)}
-. $LUSTRE/tests/test-framework.sh
-init_test_env $@
-. ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
-init_logging
+build_test_filter
require_dsh_mds || exit 0
# use small MDS + OST size to speed formatting time
# do not use too small MDSSIZE/OSTSIZE, which affect the default journal size
# 400M MDT device can guarantee uninitialized groups during the OI scrub
-MDSSIZE=400000
-OSTSIZE=200000
+[[ $MDSSIZE < 400000 || "$mds1_FSTYPE" == ldiskfs ]] && MDSSIZE=400000
+[[ $OSTSIZE < 400000 || "$ost1_FSTYPE" == ldiskfs ]] && OSTSIZE=400000
# no need too many OSTs, to reduce the format/start/stop overhead
[ $OSTCOUNT -gt 4 ] && OSTCOUNT=4
# build up a clean test environment.
REFORMAT="yes" check_and_setup_lustre
-build_test_filter
-
MDT_DEV="${FSNAME}-MDT0000"
OST_DEV="${FSNAME}-OST0000"
-MDT_DEVNAME=$(mdsdevname ${SINGLEMDS//mds/})
scrub_start() {
local error_id=$1
stop $SINGLEMDS > /dev/null || error "(6) Fail to stop MDS!"
echo "start $SINGLEMDS with disabling OI scrub"
- start $SINGLEMDS $MDT_DEVNAME $MOUNT_OPTS_NOSCRUB > /dev/null ||
+ start $SINGLEMDS $(mdsdevname 1) $MOUNT_OPTS_NOSCRUB > /dev/null ||
error "(7) Fail to start MDS!"
local FLAGS=$($SHOW_SCRUB | awk '/^flags/ { print $2 }')
}
run_test 4c "Auto trigger OI scrub if bad OI mapping was found (3)"
+test_4d() {
+ [ $(facet_fstype $SINGLEMDS) != "ldiskfs" ] && skip "ldiskfs only test"
+
+ check_mount_and_prep
+
+ #define OBD_FAIL_OSD_DUPLICATE_MAP 0x19b
+ do_nodes $(comma_list $(osts_nodes)) $LCTL set_param fail_loc=0x19b
+ for i in {1..100}; do
+ echo $i > $DIR/$tdir/f_$i || error "write f_$i failed"
+ done
+ do_nodes $(comma_list $(osts_nodes)) $LCTL set_param fail_loc=0
+
+ for i in {101..200}; do
+ echo $i > $DIR/$tdir/f_$i || error "write f_$i failed"
+ done
+
+ for i in {1..200}; do
+ echo $i | cmp $DIR/$tdir/f_$i - || error "f_$i data corrupt"
+ done
+}
+run_test 4d "FID in LMA mismatch with object FID won't block create"
+
test_5() {
formatall > /dev/null
setupall > /dev/null
test_12() {
check_mount_and_prep
- $SETSTRIPE -c 1 -i 0 $DIR/$tdir
+ $LFS setstripe -c 1 -i 0 $DIR/$tdir
#define OBD_FAIL_OSD_COMPAT_INVALID_ENTRY 0x195
do_facet ost1 $LCTL set_param fail_loc=0x195
test_13() {
check_mount_and_prep
- $SETSTRIPE -c 1 -i 0 $DIR/$tdir
+ $LFS setstripe -c 1 -i 0 $DIR/$tdir
#define OBD_FAIL_OSD_COMPAT_NO_ENTRY 0x196
do_facet ost1 $LCTL set_param fail_loc=0x196