}
check_mount2() {
- do_facet client "touch $DIR/a" || return 71
- do_facet client "rm $DIR/a" || return 72
- do_facet client "touch $DIR2/a" || return 73
- do_facet client "rm $DIR2/a" || return 74
+ do_facet client "touch $DIR/a" || return 71
+ do_facet client "rm $DIR/a" || return 72
+ do_facet client "touch $DIR2/a" || return 73
+ do_facet client "rm $DIR2/a" || return 74
echo "setup double mount lustre success"
}
test_2() {
start_ost
- start_mds
+ start_mds
echo "start mds second time.."
start_mds
mount_client $MOUNT
grep " $MOUNT " /etc/mtab && echo "test 5b: mtab before mount" && return 10
mount_client $MOUNT && return 1
grep " $MOUNT " /etc/mtab && echo "test 5b: mtab after failed mount" && return 11
- umount_client $MOUNT
+ umount_client $MOUNT
# stop_mds is a no-op here, and should not fail
cleanup_nocli || return $?
return 0
fi
cleanup
- return 0
+ return 0
}
run_test 34b "force umount with failed mds should be normal"
fi
cleanup
- return 0
+ return 0
}
run_test 34c "force umount with failed ost should be normal"
do_facet mds "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new\\\" $MDSDEV"
do_facet mds "od -Ax -td8 $TMP/lov_objid.new"
[ "$ERROR" = "y" ] && error "old and new files are different after connect" || true
-
-
+
+
# check it's updates in sync
umount_client $MOUNT
stop_mds
-
+
do_facet mds dd if=/dev/zero of=$TMP/lov_objid.clear bs=4096 count=1
do_facet mds "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
do_facet mds "$DEBUGFS -w -R \\\"write $TMP/lov_objid.clear lov_objid\\\" $MDSDEV "
umount_client $MOUNT
stop_mds
[ "$ERROR" = "y" ] && error "old and new files are different after sync" || true
-
+
log "files compared the same"
cleanup
}
local rc
start mds $MDSDEV $MDS_MOUNT_OPTS -o nosvc -n
start ost1 `ostdevname 1` $OST_MOUNT_OPTS
- start mds $MDSDEV $MDS_MOUNT_OPTS -o nomgs
+ start mds $MDSDEV $MDS_MOUNT_OPTS -o nomgs,force
mkdir -p $MOUNT
mount_client $MOUNT || return 1
sleep 5
wait_osc_import_state mds ost FULL
#start_client
mount_client $MOUNT || return 3
-
+
start_ost2 || return 4
start ost3 `ostdevname 3` $OST_MOUNT_OPTS || return 5
start ost4 `ostdevname 4` $OST_MOUNT_OPTS || return 6
done
stat $MOUNT/widestripe || return 12
-
+
cleanup_48
return 0
}
stop_mds || return 3
OST_MKFS_OPTS="--ost --fsname=$FSNAME --device-size=$OSTSIZE --mgsnode=$MGSNID --param sys.timeout=$LOCAL_TIMEOUT --param sys.ldlm_timeout=$((LOCAL_TIMEOUT - 1)) $MKFSOPT $OSTOPT"
-
+
reformat
start_mds || return 4
start_ost || return 5
if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
fi
-
+
if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT - 1)) ]; then
error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
fi
-
+
cleanup || return $?
MDS_MKFS_OPTS=$OLD_MDS_MKFS_OPTS
test_50e() {
local RC1
local pid
-
+
reformat_and_config
start_mds || return 1
#first client should see only one ost
# Wait for client to detect down OST
stop_ost || error "Unable to stop OST1"
wait_osc_import_state mds ost DISCONN
-
+
mount_client $MOUNT || error "Unable to mount client"
lctl set_param llite.$FSNAME-*.lazystatfs=0
-
+
multiop_bg_pause $MOUNT _f
RC1=$?
pid=$!
fi
umount_client $MOUNT || error "Unable to unmount client"
- stop_ost || error "Unable to stop OST1"
+ stop_ost || error "Unable to stop OST1"
stop_mds || error "Unable to stop MDS"
}
run_test 50e "normal statfs all servers down =========================="
local RC1
local pid
CONN_PROC="osc.$FSNAME-OST0001-osc.ost_server_uuid"
-
+
start_mds || error "Unable to start mds"
#first client should see only one ost
start_ost || error "Unable to start OST1"
# Wait for client to detect down OST
stop_ost2 || error "Unable to stop OST2"
wait_osc_import_state mds ost2 DISCONN
-
+
mount_client $MOUNT || error "Unable to mount client"
lctl set_param llite.$FSNAME-*.lazystatfs=0
-
+
multiop_bg_pause $MOUNT _f
RC1=$?
pid=$!
fi
umount_client $MOUNT || error "Unable to unmount client"
- stop_ost || error "Unable to stop OST1"
+ stop_ost || error "Unable to stop OST1"
stop_mds || error "Unable to stop MDS"
}
run_test 50f "normal statfs one server in down =========================="
"\t<filesystem>: name of the Lustre filesystem (e.g. lustre1)\n"
"\t<mountpt>: filesystem mountpoint (e.g. /mnt/lustre)\n"
"\t-f|--fake: fake mount (updates /etc/mtab)\n"
- "\t--force: force mount even if already in /etc/mtab\n"
+ "\t-o force|--force: force mount even if already in /etc/mtab\n"
"\t-h|--help: print this usage message\n"
"\t-n|--nomtab: do not update /etc/mtab after mount\n"
"\t-v|--verbose: print verbose config settings\n"
retry = MAX_RETRIES;
else if (retry < 0)
retry = 0;
- }
- else if (parse_one_option(opt, flagp) == 0) {
+ } else if (strncmp(opt, "force", 5) == 0) {
+ //XXX special check for 'force' option
+ ++force;
+ printf("force: %d\n", force);
+ } else if (parse_one_option(opt, flagp) == 0) {
/* pass this on as an option */
if (*options)
strcat(options, ",");