(( $val == 1 )) || error "obdfilter.$FSNAME-OST0001*.no_precreate=$val"
mount_client $MOUNT || error "mount client failed"
+ wait_osc_import_state mds1 ost1 FULL
+ wait_osc_import_state client ost1 FULL
wait_osc_import_state client ost2 FULL
$LFS setstripe -i 0 $DIR/$tfile.0 ||
sleep_maxage
$LFS setstripe -i 1 $DIR/$tfile.2 ||
error "failed to create $tfile.2 on ost1 facet"
+ # files not cleaned with ONLY_REPEAT because of client unmount below
+ rm -f $DIR/$tfile.[012]
stop_ost2 || error "stop ost2 facet failed"
cleanup
}
[ -z $mds2failover_HOST ] && skip "needs MDT failover setup"
setup
+ do_facet mgs $LCTL --device MGS llog_print $FSNAME-client |
+ grep 1.2.3.4@tcp && error "Should not be fake nid"
+ do_facet mgs $LCTL conf_param $FSNAME-MDT0001.failover.node=1.2.3.4@tcp\
+ || error "Set params error"
+ do_facet mgs $LCTL --device MGS llog_print $FSNAME-client |
+ grep 1.2.3.4@tcp || error "Fake nid should be added"
cleanup
load_modules
}
run_test 127 "direct io overwrite on full ost"
+test_128()
+{
+ combined_mgs_mds && skip "need separate mgs device"
+ [ "$ost2_FSTYPE" == zfs ] && import_zpool ost2
+
+ format_ost 2
+ # Try to apply nolocallogs to the virgin OST. Should fail.
+ do_facet ost2 "$TUNEFS --nolocallogs $(ostdevname 2)" &&
+ error "nolocallogs should not be allowed on the virgin target"
+
+ setupall
+ stopall
+
+ [ "$ost1_FSTYPE" == zfs ] && import_zpool ost1
+ # Start OST without MGS (local configs)
+ do_facet ost1 "$TUNEFS --dryrun $(ostdevname 1)"
+ start_ost || error "unable to start OST1"
+ stop_ost || error "Unable to stop OST1"
+
+ [ "$ost1_FSTYPE" == zfs ] && import_zpool ost1
+ # Do not allow reading local configs, should fail
+ do_facet ost1 "$TUNEFS --nolocallogs $(ostdevname 1)" ||
+ error "Can not set nolocallogs"
+ start_ost && error "OST1 started, but should fail"
+
+ # Connect to MGS successfully, reset nolocallogs flag
+ [ "$ost1_FSTYPE" == zfs ] && import_zpool ost1
+ start_mgs || error "unable to start MGS"
+ start_ost || error "unable to start OST1"
+
+ do_facet ost1 "$TUNEFS --dryrun $(ostdevname 1)" | grep "nolocallogs" &&
+ error "nolocallogs expected to be reset"
+
+ stop_ost || error "Unable to stop OST1"
+}
+run_test 128 "Force using remote logs with --nolocallogs"
+
if ! combined_mgs_mds ; then
stop mgs
fi