char *log = mti->mti_svname;
struct llog_handle *llh = NULL;
char *uuid, *lovname;
- char mdt_index[5];
+ char mdt_index[6];
char *ptr = mti->mti_params;
int rc = 0, failout = 0;
ENTRY;
rc = mgs_write_log_lov(obd, fsdb, mti, log, lovname);
sprintf(uuid, "%s_UUID", log);
- sprintf(mdt_index,"%d",mti->mti_stripe_index);
+ sprintf(mdt_index, "%d", mti->mti_stripe_index);
/* add MDT itself */
rc = record_start_log(obd, &llh, log);
RETURN(rc);
}
+static inline void name_create_mdt(char **logname, char *fsname, int i)
+{
+ char mdt_index[9];
+
+ sprintf(mdt_index, "-MDT%04x", i);
+ name_create(logname, fsname, mdt_index);
+}
+
+static void name_create_mdt_and_lov(char **logname, char **lovname,
+ struct fs_db *fsdb, int i)
+{
+ name_create_mdt(logname, fsdb->fsdb_name, i);
+ /* COMPAT_180 */
+ if (i == 0 && fsdb->fsdb_fl_oscname_18)
+ name_create(lovname, fsdb->fsdb_name, "-mdtlov");
+ else
+ name_create(lovname, *logname, "-mdtlov");
+}
+
/* 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)
struct llog_handle *llh = NULL;
char *cliname;
struct temp_comp comp = { 0 };
- char mdt_index[9];
int rc, i = 0;
ENTRY;
char *mdtname;
if (i != mti->mti_stripe_index &&
test_bit(i, fsdb->fsdb_mdt_index_map)) {
- sprintf(mdt_index,"-MDT%04x",i);
-
- name_create(&mdtname, mti->mti_fsname, mdt_index);
+ name_create_mdt(&mdtname, mti->mti_fsname, i);
rc = mgs_write_log_mdc_to_mdt(obd, fsdb, mti, mdtname);
name_destroy(&mdtname);
}
{
struct llog_handle *llh = NULL;
char *logname, *lovname;
- char mdt_index[9];
char *ptr = mti->mti_params;
int rc, flags = 0, failout = 0, i;
ENTRY;
mti->mti_svname);
}
- // for_all_existing_mdt
+ /* Add ost to all MDT lov defs */
for (i = 0; i < INDEX_MAP_SIZE * 8; i++){
- if (test_bit(i, fsdb->fsdb_mdt_index_map)) {
- sprintf(mdt_index,"-MDT%04x",i);
- name_create(&logname, mti->mti_fsname, mdt_index);
- name_create(&lovname, logname, "-mdtlov");
+ if (test_bit(i, fsdb->fsdb_mdt_index_map)) {
+ char mdt_index[9];
+
+ name_create_mdt_and_lov(&logname, &lovname, fsdb, i);
+ sprintf(mdt_index, "-MDT%04x", i);
mgs_write_log_osc_to_lov(obd, fsdb, mti, logname,
mdt_index, lovname,
LUSTRE_SP_MDT, flags);
if (class_match_param(ptr, PARAM_OSC""PARAM_ACTIVE, &tmp) == 0) {
/* active=0 means off, anything else means on */
- char mdt_index[16];
int flag = (*tmp == '0') ? CM_EXCLUDE : 0;
int i;
for (i = 0; i < INDEX_MAP_SIZE * 8; i++) {
if (!test_bit(i, fsdb->fsdb_mdt_index_map))
continue;
- sprintf(mdt_index,"-MDT%04x", i);
- name_create(&logname, mti->mti_fsname, mdt_index);
+ name_create_mdt(&logname, mti->mti_fsname, i);
rc = mgs_modify(obd, fsdb, mti, logname,
mti->mti_svname, "add osc", flag);
name_destroy(&logname);
/* All lov. in proc */
if (class_match_param(ptr, PARAM_LOV, NULL) == 0) {
- char mdt_index[16];
char *mdtlovname;
CDEBUG(D_MGS, "lov param %s\n", ptr);
if (mgs_log_is_empty(obd, mti->mti_svname))
GOTO(end, rc = -ENODEV);
- sprintf(mdt_index,"-MDT%04x", mti->mti_stripe_index);
- name_create(&logname, mti->mti_fsname, mdt_index);
- name_create(&mdtlovname, logname, "-mdtlov");
+ name_create_mdt_and_lov(&logname, &mdtlovname, fsdb,
+ mti->mti_stripe_index);
rc = mgs_wlp_lcfg(obd, fsdb, mti, mti->mti_svname,
&bufs, mdtlovname, ptr);
name_destroy(&logname);
name_create(&cname, mti->mti_svname, mdt_index);
name_destroy(&logname);
- sprintf(mdt_index, "-MDT%04x", i);
- name_create(&logname, mti->mti_fsname,
- mdt_index);
+ name_create_mdt(&logname, mti->mti_fsname, i);
if (!mgs_log_is_empty(obd, logname))
rc = mgs_wlp_lcfg(obd, fsdb,
mti, logname,
/* All mdt. params in proc */
if (class_match_param(ptr, PARAM_MDT, NULL) == 0) {
- char mdt_index[16];
int i;
__u32 idx;
if (!test_bit(i,
fsdb->fsdb_mdt_index_map))
continue;
- sprintf(mdt_index,"-MDT%04x", i);
- name_create(&logname, mti->mti_fsname,
- mdt_index);
+ name_create_mdt(&logname, mti->mti_fsname, i);
rc = mgs_wlp_lcfg(obd, fsdb, mti,
logname, &bufs,
logname, ptr);
char *fsname, char *poolname, char *ostname)
{
struct fs_db *fsdb;
- char mdt_index[16];
char *lovname;
char *logname;
char *label = NULL, *canceled_label = NULL;
GOTO(out, rc = -ENOMEM);
}
- /* loop on all potential MDT */
+ /* write pool def to all MDT logs */
for (i = 0; i < INDEX_MAP_SIZE * 8; i++) {
if (test_bit(i, fsdb->fsdb_mdt_index_map)) {
- sprintf(mdt_index, "-MDT%04x", i);
- name_create(&logname, fsname, mdt_index);
- name_create(&lovname, logname, "-mdtlov");
+ name_create_mdt_and_lov(&logname, &lovname, fsdb, i);
if (canceled_label != NULL) {
strcpy(mti->mti_svname, "lov pool");
}
test_32a() {
- # this test is totally useless on a client-only system
client_only && skip "client only testing" && return 0
[ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
[ -z "$TUNEFS" ] && skip_env "No tunefs" && return 0
local NID=$($LCTL list_nids | head -1)
- echo "OSC changes should return err:"
+ echo "OSC changes should succeed:"
$LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 || return 7
$LCTL conf_param lustre-OST0000.failover.node=$NID || return 8
-
echo "ok."
+
echo "MDC changes should succeed:"
$LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
$LCTL conf_param lustre-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
+ echo "ok."
+
cleanup_32
# mount a second time to make sure we didnt leave upgrade flag on
run_test 32a "Upgrade from 1.8 (not live)"
test_32b() {
- # this test is totally useless on a client-only system
client_only && skip "client only testing" && return 0
[ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
[ -z "$TUNEFS" ] && skip_env "No tunefs" && return
local NID=$($LCTL list_nids | head -1)
echo "OSC changes should succeed:"
-
$LCTL conf_param ${NEWNAME}-OST0000.osc.max_dirty_mb=15 || return 7
$LCTL conf_param ${NEWNAME}-OST0000.failover.node=$NID || return 8
-
echo "ok."
+
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
+ echo "ok."
+
+ echo "LOV changes should succeed:"
+ $LCTL pool_new lustre.interop || return 11
+ $LCTL conf_param lustre-MDT0000.lov.stripesize=4M || return 12
echo "ok."
# MDT and OST should have registered with new nids, so we should have