name_create(lovname, *logname, "-mdtlov");
}
+static inline void name_create_mdt_osc(char **oscname, char *ostname,
+ struct fs_db *fsdb, int i)
+{
+ char suffix[16];
+
+ if (i == 0 && fsdb->fsdb_fl_oscname_18)
+ sprintf(suffix, "-osc");
+ else
+ sprintf(suffix, "-osc-MDT%04x", i);
+ name_create(oscname, ostname, suffix);
+}
+
/* envelope method for all layers log */
static int mgs_write_log_mdt(struct obd_device *obd, struct fs_db *fsdb,
struct mgs_target_info *mti)
rc = record_end_log(obd, &llh);
}
name_destroy(&logname);
+ name_destroy(&cliname);
if (mti->mti_flags & LDD_F_SV_TYPE_OST) {
- /* Add OST failover nids to the MDT log as well */
- name_create(&logname, mti->mti_fsname, "-MDT0000");
- rc = record_start_log(obd, &llh, logname);
- if (!rc) {
- rc = record_marker(obd, llh, fsdb, CM_START,
- mti->mti_svname, "add failnid");
- rc = mgs_write_log_failnids(obd, mti, llh, cliname);
- rc = record_marker(obd, llh, fsdb, CM_END,
- mti->mti_svname, "add failnid");
- rc = record_end_log(obd, &llh);
+ /* Add OST failover nids to the MDT logs as well */
+ int i;
+
+ for (i = 0; i < INDEX_MAP_SIZE * 8; i++) {
+ if (!test_bit(i, fsdb->fsdb_mdt_index_map))
+ continue;
+ name_create_mdt(&logname, mti->mti_fsname, i);
+ name_create_mdt_osc(&cliname, mti->mti_svname, fsdb, i);
+
+ rc = record_start_log(obd, &llh, logname);
+ if (!rc) {
+ rc = record_marker(obd, llh, fsdb, CM_START,
+ mti->mti_svname,
+ "add failnid");
+ rc = mgs_write_log_failnids(obd, mti, llh,
+ cliname);
+ rc = record_marker(obd, llh, fsdb, CM_END,
+ mti->mti_svname,
+ "add failnid");
+ rc = record_end_log(obd, &llh);
+ }
+ name_destroy(&cliname);
+ name_destroy(&logname);
}
- name_destroy(&logname);
}
- name_destroy(&cliname);
RETURN(rc);
}
if (rc)
goto active_err;
/* Modify mdtlov */
- /* FIXME add to all MDT logs for CMD */
+ /* Add to all MDT logs for CMD */
for (i = 0; i < INDEX_MAP_SIZE * 8; i++) {
if (!test_bit(i, fsdb->fsdb_mdt_index_map))
continue;
/* osc params affect the MDT as well */
if (!rc && (mti->mti_flags & LDD_F_SV_TYPE_OST)) {
- char mdt_index[16];
int i;
for (i = 0; i < INDEX_MAP_SIZE * 8; i++){
if (!test_bit(i, fsdb->fsdb_mdt_index_map))
continue;
-
name_destroy(&cname);
- if (i == 0 && fsdb->fsdb_fl_oscname_18)
- sprintf(mdt_index, "-osc");
- else
- sprintf(mdt_index, "-osc-MDT%04x", i);
- name_create(&cname, mti->mti_svname, mdt_index);
-
+ name_create_mdt_osc(&cname, mti->mti_svname,
+ fsdb, i);
name_destroy(&logname);
name_create_mdt(&logname, mti->mti_fsname, i);
if (!mgs_log_is_empty(obd, logname))
- rc = mgs_wlp_lcfg(obd, fsdb,
- mti, logname,
- &bufs, cname,
- ptr);
+ rc = mgs_wlp_lcfg(obd, fsdb,mti,logname,
+ &bufs, cname, ptr);
if (rc)
break;
}
#!/bin/bash
-# requirement:
-# add uml1 uml2 uml3 in your /etc/hosts
+# -*- mode: Bash; tab-width: 4; indent-tabs-mode: t; -*-
+# vim:autoindent:shiftwidth=4:tabstop=4:
# FIXME - there is no reason to use all of these different
# return codes, espcially when most of them are mapped to something
{ skip_env "Cannot untar $DISK1_8" && return ; }
load_modules
- $LCTL set_param debug=$PTLDEBUG
+ $LCTL set_param debug="config"
local NEWNAME=lustre
# writeconf will cause servers to register with their current nids
echo MDS uuid $UUID
[ "$UUID" == "${NEWNAME}-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
- $TUNEFS --mgsnode=$HOSTNAME --writeconf --fsname=$NEWNAME $tmpdir/ost1 || error "tunefs failed"
+ $TUNEFS --mgsnode=$HOSTNAME --writeconf --fsname=$NEWNAME $tmpdir/ost1 ||\
+ error "tunefs failed"
start32 ost1 $tmpdir/ost1 "-o loop" || return 5
UUID=$($LCTL get_param -n obdfilter.${NEWNAME}-OST0000.uuid)
echo OST uuid $UUID
echo "MDC changes should succeed:"
$LCTL conf_param ${NEWNAME}-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
- $LCTL conf_param lustre-MDT0000.failover.node=$NID || return 10
+ $LCTL conf_param ${NEWNAME}-MDT0000.failover.node=$NID || return 10
echo "ok."
echo "LOV changes should succeed:"
- $LCTL pool_new lustre.interop || return 11
- $LCTL conf_param lustre-MDT0000.lov.stripesize=4M || return 12
+ $LCTL pool_new ${NEWNAME}.interop || return 11
+ $LCTL conf_param ${NEWNAME}-MDT0000.lov.stripesize=4M || return 12
echo "ok."
# MDT and OST should have registered with new nids, so we should have