struct mgs_direntry *de;
char *key;
int rc, key_sz;
- size_t suffix_len = sizeof(".bak") - 1;
INIT_LIST_HEAD(log_list);
goto next;
}
- /* filter out ".bak" files */
- if (key_sz >= suffix_len &&
- !memcmp(".bak", key + key_sz - suffix_len, suffix_len)) {
+ /* filter out backup files */
+ if (lu_name_is_backup_file(key, key_sz, NULL)) {
CDEBUG(D_MGS, "Skipping backup file %.*s\n",
key_sz, key);
goto next;
/* skip self export */
if (exp == mgs_obd->obd_self_export)
continue;
- if (exp_connect_flags(exp) & OBD_CONNECT_MDS_MDS)
- continue;
++num_exports;
- CERROR("%s: node %s still connected during replace_nids "
- "connect_flags:%llx\n",
- mgs_obd->obd_name,
- libcfs_nid2str(exp->exp_nid_stats->nid),
- exp_connect_flags(exp));
-
+ if (num_exports > 1)
+ CERROR("%s: node %s still connected during replace_nids connect_flags:%llx\n",
+ mgs_obd->obd_name,
+ libcfs_nid2str(exp->exp_nid_stats->nid),
+ exp_connect_flags(exp));
}
spin_unlock(&mgs_obd->obd_dev_lock);
- /* osd, MGS and MGC + self_export
- (wc -l /proc/fs/lustre/devices <= 2) && (non self exports == 0) */
- return (num_devices <= 3) && (num_exports == 0);
+ /* osd, MGS and MGC + MGC export (nosvc starts MGC)
+ * (wc -l /proc/fs/lustre/devices <= 3) && (non self exports == 1)
+ */
+ return (num_devices <= 3) && (num_exports <= 1);
}
static int name_create_mdt(char **logname, char *fsname, int mdt_idx)
}
/* Process client llogs */
- name_create(&logname, fsname, "-client");
+ rc = name_create(&logname, fsname, "-client");
+ if (rc)
+ GOTO(out, rc);
rc = mgs_replace_nids_log(env, mgs_obd, logname, devname, nids);
name_destroy(&logname);
if (rc) {
for (i = 0; i < INDEX_MAP_SIZE * 8; i++) {
if (!test_bit(i, fsdb->fsdb_mdt_index_map))
continue;
- name_create_mdt(&logname, fsname, i);
+ rc = name_create_mdt(&logname, fsname, i);
+ if (rc)
+ GOTO(out, rc);
rc = mgs_replace_nids_log(env, mgs_obd, logname, devname, nids);
name_destroy(&logname);
if (rc)
rc = nodemap_set_deny_unknown(nodemap_name, bool_switch);
break;
case LCFG_NODEMAP_AUDIT_MODE:
- rc = kstrtoul(param, 10, (unsigned long *)&bool_switch);
+ rc = kstrtobool(param, &bool_switch);
if (rc == 0)
rc = nodemap_set_audit_mode(nodemap_name, bool_switch);
break;