#define LDD_F_SV_TYPE_MDT 0x0001
#define LDD_F_SV_TYPE_OST 0x0002
#define LDD_F_SV_TYPE_MGS 0x0004
-#define LDD_F_NEED_INDEX 0x0010
-#define LDD_F_NEED_REGISTER 0x0020
+#define LDD_F_NEED_INDEX 0x0010 /* we need an index assignment */
+#define LDD_F_NEED_REGISTER 0x0020 /* we have never registered */
#define LDD_F_UPGRADE14 0x0040 /* COMPAT_14 */
+#define LDD_F_REWRITE 0x0080 /* rewrite the LDD */
+#define LDD_F_WRITECONF 0x0100 /* regenerate all logs for this fs */
enum ldd_mount_type {
MGS_CONNECT = 250,
MGS_DISCONNECT,
MGS_EXCEPTION, /* node died, etc. */
- MGS_TARGET_ADD,
+ MGS_TARGET_ADD, /* whenever target starts up */
MGS_TARGET_DEL,
MGS_LAST_OPC
} mgs_cmd_t;
#include <linux/lustre_log.h>
#include <linux/lustre_export.h>
+#define FSDB_EMPTY 0x0001
+
struct fs_db {
char fd_name[8];
struct list_head fd_list;
struct super_block *mgs_sb;
struct dentry *mgs_configs_dir;
struct dentry *mgs_fid_de;
- struct llog_handle *mgs_cfg_llh;
spinlock_t mgs_fs_db_lock;
struct list_head mgs_fs_db_list;
+ struct semaphore mgs_log_sem;
};
struct mds_obd {
if (ost_uuid && !obd_uuid_equals(ost_uuid, &lov->tgts[i].uuid))
continue;
- // FIXME remove
- CERROR("Clear orphans for %d:%s\n", i, ost_uuid->uuid);
+ CDEBUG(D_CONFIG,"Clear orphans for %d:%s\n", i, ost_uuid->uuid);
memcpy(tmp_oa, src_oa, sizeof(*tmp_oa));
struct config_llog_data *cld);
/* FIXME I don't want a thread for every cld; make a list of cld's to requeue
- and use only 1 thread. And take an obd ref to the mgc so thread stops before
- mgc (the current one is unsafe). */
-/* reenqueue and parse _all_ logs that match the lock */
+ and use only 1 thread. */
+/* reenqueue the lock, reparse the log */
static int mgc_async_requeue(void *data)
{
struct config_llog_data *cld = (struct config_llog_data *)data;
CDEBUG(D_MGC, "requeue "LPX64" %s:%s\n",
cld->cld_resid.name[0], cld->cld_logname,
cld->cld_cfg.cfg_instance);
+
+ LASSERT(the_mgc);
+ class_export_get(the_mgc->obd_self_export);
rc = mgc_process_log(the_mgc, cld);
+ class_export_put(the_mgc->obd_self_export);
RETURN(rc);
}
exp->exp_obd->obd_name, imp->imp_initial_recov_bk);
if (imp->imp_invalid) {
/* Resurrect if we previously died */
- CDEBUG(D_MGC, "Reactivate %s\n",
- imp->imp_obd->obd_name);
+ CDEBUG(D_MGC, "Reactivate %s %d:%d:%d\n",
+ imp->imp_obd->obd_name,
+ imp->imp_deactive, imp->imp_invalid,
+ imp->imp_state);
ptlrpc_activate_import(imp);
+ // lustre_reconnect_mgc(obd);
+ ptlrpc_set_import_active(imp, 1);
+ //ptlrpc_recover_import(imp);
}
RETURN(0);
}
RETURN(rc);
}
+/* identical to mgs_log_is_empty */
+static int mgc_llog_is_empty(struct obd_device *obd, struct llog_ctxt *ctxt,
+ char *name)
+{
+ struct lvfs_run_ctxt saved;
+ struct llog_handle *llh;
+ int rc = 0;
+
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+ rc = llog_create(ctxt, &llh, NULL, name);
+ if (rc == 0) {
+ llog_init_handle(llh, LLOG_F_IS_PLAIN, NULL);
+ rc = llog_get_size(llh);
+ llog_close(llh);
+ }
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+ /* header is record 1 */
+ return(rc <= 1);
+}
+
static int mgc_copy_handler(struct llog_handle *llh, struct llog_rec_hdr *rec,
void *data)
{
(class_name2obd(LUSTRE_MGS_OBDNAME) == NULL)) {
push_ctxt(&saved, &mgc->obd_lvfs_ctxt, NULL);
must_pop++;
- if (!rcl)
- /* Only try to copy log if we have the lock */
+ if (rcl == 0)
+ /* Only try to copy log if we have the lock. */
rc = mgc_copy_llog(mgc, ctxt, lctxt, cld->cld_logname);
- if (rcl || rc)
- LCONSOLE_WARN("Failed to get MGS log %s, using local "
- "copy.\n", cld->cld_logname);
+ if (rcl || rc) {
+ if (mgc_llog_is_empty(mgc, lctxt, cld->cld_logname)) {
+ LCONSOLE_ERROR("Failed to get MGS log %s "
+ "and no local copy.\n",
+ cld->cld_logname);
+ GOTO(out_pop, rc = -ENOTCONN);
+ }
+ LCONSOLE_WARN("Failed to get MGS log %s, using "
+ "local copy.\n", cld->cld_logname);
+ }
/* Now, whether we copied or not, start using the local llog.
If we failed to copy, we'll start using whatever the old
log has. */
be updated here. */
rc = class_config_parse_llog(ctxt, cld->cld_logname, &cld->cld_cfg);
+ out_pop:
if (must_pop)
pop_ctxt(&saved, &mgc->obd_lvfs_ctxt, NULL);
}
if (rc) {
- LCONSOLE_ERROR("%s: the configuration '%s' could not be read "
- "(%d) from the MGS.\n",
- mgc->obd_name, cld->cld_logname, rc);
+ CERROR("%s: the configuration '%s' could not be read "
+ "(%d) from the MGS.\n",
+ mgc->obd_name, cld->cld_logname, rc);
}
RETURN(rc);
/* Internal mgs setup */
mgs_init_db_list(obd);
+ sema_init(&mgs->mgs_log_sem, 1);
/* Start the service threads */
mgs->mgs_service =
return 0;
}
+/* rc=0 means ok */
+static int mgs_check_target(struct obd_device *obd, struct mgs_target_info *mti)
+{
+ int rc;
+ ENTRY;
+
+ rc = mgs_check_index(obd, mti);
+ if (rc == 0) {
+ LCONSOLE_ERROR("Index for %s has disappeared! "
+ "Regenerating this portion of the logs."
+ "\n", mti->mti_svname);
+ mti->mti_flags |= LDD_F_NEED_REGISTER;
+ rc = 1;
+ } else if (rc == -1) {
+ LCONSOLE_ERROR("Client log %s-client has disappeared! "
+ "Regenerating all logs.\n",
+ mti->mti_fsname);
+ mti->mti_flags |= LDD_F_WRITECONF;
+ rc = 1;
+ } else {
+ /* index is correctly marked used */
+ rc = 0;
+ }
+
+ /* FIXME If the logs don't contain the mti_nids then add
+ them all as failover nids */
+
+ RETURN(rc);
+}
+
+/* Called whenever a target starts up. Flags indicate first connect, etc. */
static int mgs_handle_target_add(struct ptlrpc_request *req)
{
struct obd_device *obd = req->rq_export->exp_obd;
struct lustre_handle lockh;
struct mgs_target_info *mti, *rep_mti;
int rep_size = sizeof(*mti);
- int rc, lockrc;
+ int rc = 0, lockrc;
ENTRY;
mti = lustre_swab_reqbuf(req, 0, sizeof(*mti),
lustre_swab_mgs_target_info);
+ if (!(mti->mti_flags & (LDD_F_WRITECONF | LDD_F_UPGRADE14 |
+ LDD_F_NEED_REGISTER))) {
+ /* We're just here as a startup ping. */
+ CDEBUG(D_MGS, "Server %s has started on %s\n", mti->mti_svname,
+ obd_export_nid2str(req->rq_export));
+ rc = mgs_check_target(obd, mti);
+ /* above will set appropriate mti flags */
+ if (!rc)
+ /* Nothing wrong, don't revoke lock */
+ GOTO(out_nolock, rc);
+ }
+
/* revoke the config lock so everyone will update */
lockrc = mgs_get_cfg_lock(obd, mti->mti_fsname, &lockh);
if (lockrc != ELDLM_OK) {
lockrc);
}
+ /* There can be only 1 server adding at a time - don't want log
+ writing contention. */
+ down(&obd->u.mgs.mgs_log_sem);
+
+ if (mti->mti_flags & LDD_F_WRITECONF) {
+ CERROR("regen all logs for fs %s\n", mti->mti_fsname);
+ rc = mgs_erase_logs(obd, mti->mti_fsname);
+ mti->mti_flags |= LDD_F_NEED_REGISTER;
+ /* FIXME regen the rest of the logs too. Special lock revoke
+ flag? */
+ LCONSOLE_ERROR("All servers must be restarted in order to "
+ "regenerate the configuration logs.\n");
+
+ mti->mti_flags &= ~LDD_F_WRITECONF;
+ mti->mti_flags |= LDD_F_REWRITE;
+ }
+
/* COMPAT_146 */
if (mti->mti_flags & LDD_F_UPGRADE14) {
CDEBUG(D_MGS, "upgrading fs %s from pre-1.6\n",
CERROR("Can't upgrade from 1.4 (%d)\n", rc);
GOTO(out, rc);
}
-
+
mti->mti_flags &= ~LDD_F_UPGRADE14;
+ mti->mti_flags |= LDD_F_REWRITE;
}
/* end COMPAT_146 */
GOTO(out, rc);
}
- mti->mti_flags &= ~LDD_F_NEED_REGISTER;
+ mti->mti_flags &= ~(LDD_F_NEED_REGISTER | LDD_F_NEED_INDEX);
+ mti->mti_flags |= LDD_F_REWRITE;
}
out:
+ up(&obd->u.mgs.mgs_log_sem);
/* done with log update */
if (lockrc == ELDLM_OK)
mgs_put_cfg_lock(&lockh);
-
+out_nolock:
CDEBUG(D_MGS, "replying with %s, index=%d, rc=%d\n", mti->mti_svname,
mti->mti_stripe_index, rc);
lustre_pack_reply(req, 1, &rep_size, NULL);
int mgs_init_db_list(struct obd_device *obd);
int mgs_cleanup_db_list(struct obd_device *obd);
+int mgs_check_index(struct obd_device *obd, struct mgs_target_info *mti);
int mgs_set_index(struct obd_device *obd, struct mgs_target_info *mti);
int mgs_write_log_target(struct obd_device *obd, struct mgs_target_info *mti);
int mgs_upgrade_sv_14(struct obd_device *obd, struct mgs_target_info *mti);
+int mgs_erase_logs(struct obd_device *obd, char *fsname);
+
#endif
if (rc)
GOTO(out_close, rc);
+ if (llog_get_size(loghandle) <= 1)
+ db->fd_flags |= FSDB_EMPTY;
+
rc = llog_process(loghandle, mgsdb_handler, (void *)db, NULL);
CDEBUG(D_MGS, "get_db = %d\n", rc);
out_close:
return 0;
}
+/* 1 = index in use
+ 0 = index unused
+ -1= empty client log */
+int mgs_check_index(struct obd_device *obd, struct mgs_target_info *mti)
+{
+ struct fs_db *db;
+ void *imap;
+ int rc = 0;
+ ENTRY;
+
+ LASSERT(!(mti->mti_flags & LDD_F_NEED_INDEX));
+
+ rc = mgs_find_or_make_db(obd, mti->mti_fsname, &db);
+ if (rc) {
+ CERROR("Can't get db for %s\n", mti->mti_fsname);
+ RETURN(rc);
+ }
+
+ if (db->fd_flags & FSDB_EMPTY)
+ RETURN(-1);
+
+ if (mti->mti_flags & LDD_F_SV_TYPE_OST)
+ imap = db->fd_ost_index_map;
+ else if (mti->mti_flags & LDD_F_SV_TYPE_MDT)
+ imap = db->fd_mdt_index_map;
+ else
+ RETURN(-EINVAL);
+
+ if (test_bit(mti->mti_stripe_index, imap))
+ RETURN(1);
+ RETURN(0);
+}
+
+
int mgs_set_index(struct obd_device *obd, struct mgs_target_info *mti)
{
struct fs_db *db;
CERROR("Unknown target type %#x, can't create log for %s\n",
mti->mti_flags, mti->mti_svname);
}
+
+ if (!rc)
+ db->fd_flags &= ~FSDB_EMPTY;
+
return rc;
}
}
/* end COMPAT_146 */
+static int mgs_clear_log(struct obd_device *obd, char *name)
+{
+ struct lvfs_run_ctxt saved;
+ struct llog_handle *llh;
+ int rc = 0;
+
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+ rc = llog_create(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT),
+ &llh, NULL, name);
+ if (rc == 0) {
+ llog_init_handle(llh, LLOG_F_IS_PLAIN, NULL);
+ rc = llog_destroy(llh);
+ llog_free_handle(llh);
+ }
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+
+ if (rc)
+ CERROR("failed to clear log %s: %d\n", name, rc);
+
+ return(rc);
+}
+
+static int dentry_readdir(struct obd_device *obd, struct dentry *dir,
+ struct vfsmount *inmnt,
+ struct list_head *dentry_list){
+ /* see mds_cleanup_pending */
+ struct lvfs_run_ctxt saved;
+ struct file *file;
+ struct dentry *dentry;
+ struct vfsmount *mnt;
+ int rc = 0;
+ ENTRY;
+
+ push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+ dentry = dget(dir);
+ if (IS_ERR(dentry))
+ GOTO(out_pop, rc = PTR_ERR(dentry));
+ mnt = mntget(inmnt);
+ if (IS_ERR(mnt)) {
+ l_dput(dentry);
+ GOTO(out_pop, rc = PTR_ERR(mnt));
+ }
+
+ file = dentry_open(dentry, mnt, O_RDONLY);
+ if (IS_ERR(file))
+ /* dentry_open_it() drops the dentry, mnt refs */
+ GOTO(out_pop, rc = PTR_ERR(file));
+
+ INIT_LIST_HEAD(dentry_list);
+ rc = l_readdir(file, dentry_list);
+ filp_close(file, 0);
+ /* filp_close->fput() drops the dentry, mnt refs */
+
+out_pop:
+ pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
+ RETURN(rc);
+}
+
+/* erase all logs for the given fs */
+int mgs_erase_logs(struct obd_device *obd, char *fsname)
+{
+ struct mgs_obd *mgs = &obd->u.mgs;
+ struct list_head dentry_list;
+ struct l_linux_dirent *dirent, *n;
+ int rc, len = strlen(fsname);
+ ENTRY;
+
+ /* Find all the logs in the CONFIGS directory */
+ rc = dentry_readdir(obd, mgs->mgs_configs_dir,
+ mgs->mgs_vfsmnt, &dentry_list);
+ if (rc) {
+ CERROR("Can't read %s dir\n", MOUNT_CONFIGS_DIR);
+ RETURN(rc);
+ }
+
+ list_for_each_entry_safe(dirent, n, &dentry_list, lld_list) {
+ list_del(&dirent->lld_list);
+ if (strncmp(fsname, dirent->lld_name, len) == 0) {
+ CDEBUG(D_MGS, "Removing log %s\n", dirent->lld_name);
+ mgs_clear_log(obd, dirent->lld_name);
+ }
+ OBD_FREE(dirent, sizeof(*dirent));
+ }
+ RETURN(rc);
+}
+
#if 0
/******************** unused *********************/
return rc;
}
-static int mgs_clear_log(struct obd_device *obd, char *name)
-{
- struct lvfs_run_ctxt saved;
- struct llog_handle *llh;
- int rc = 0;
-
- push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
- rc = llog_create(llog_get_context(obd, LLOG_CONFIG_ORIG_CTXT),
- &llh, NULL, name);
- if (rc == 0) {
- llog_init_handle(llh, LLOG_F_IS_PLAIN, NULL);
- rc = llog_destroy(llh);
- llog_free_handle(llh);
- }
- pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
-
- if (rc)
- CERROR("failed to clear log %s: %d\n", name, rc);
-
- return(rc);
-}
-
/* from mdt_iocontrol */
int mgs_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
void *karg, void *uarg)
#include <linux/obd.h>
#include <linux/lvfs.h>
#include <linux/lustre_fsfilt.h>
-//#include <linux/lustre_mgs.h>
#include <linux/obd_class.h>
#include <lustre/lustre_user.h>
#include <linux/version.h>
RETURN(rc);
}
-#if 0
-int parse_last_rcvd(struct obd_device *obd, char *uuid, int *first_mount)
-{
- struct lvfs_run_ctxt saved;
- struct file *file;
- struct lr_server_data *lsd;
- loff_t off = 0;
- int rc;
-
- OBD_ALLOC_WAIT(lsd, sizeof(*lsd));
- if (!lsd)
- return -ENOMEM;
-
- /* requires a mounted device */
- LASSERT(obd);
- /*setup llog ctxt*/
- push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
-
- /* open and test the last rcvd file */
- file = filp_open(LAST_RCVD, O_RDONLY, 0644);
- if (IS_ERR(file)) {
- rc = PTR_ERR(file);
- CERROR("cannot open %s file: rc = %d\n", LAST_RCVD, rc);
- goto out;
- }
-
- CDEBUG(D_MOUNT, "Have last_rcvd, size %lu\n",
- (unsigned long)file->f_dentry->d_inode->i_size);
- rc = fsfilt_read_record(obd, file, lsd, sizeof(*lsd), &off);
- if (rc) {
- CERROR("error reading %s: rc %d\n", LAST_RCVD, rc);
- goto out_close;
- }
-
- strcpy(uuid, lsd->lsd_uuid);
- *first_mount = (lsd->lsd_mount_count == 0);
- CDEBUG(D_MOUNT, "UUID from %s: %s, init=%d\n",
- LAST_RCVD, uuid, *first_mount);
-
-out_close:
- filp_close(file, 0);
-out:
- pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
- OBD_FREE(lsd, sizeof(*lsd));
- return(rc);
-}
-#endif
-
/**************** config llog ********************/
KEY_INIT_RECOV_BACKUP,
sizeof(recov_bk), &recov_bk);
+#if 0
+ /* induces a module loop with ptlrpc */
+ if (imp->imp_invalid) {
+ /* Resurrect if we previously died */
+ CDEBUG(D_MOUNT, "Reactivate %s %d:%d:%d\n",
+ imp->imp_obd->obd_name,
+ imp->imp_deactive, imp->imp_invalid,
+ imp->imp_state);
+ ptlrpc_activate_import(imp);
+ // lustre_reconnect_mgc(obd);
+ ptlrpc_set_import_active(imp, 1);
+ //ptlrpc_recover_import(imp);
+ }
+#endif
GOTO(out, rc = 0);
}
RETURN(rc);
}
-/* Add this target to the fs, get a new index if needed */
-static int server_add_target(struct super_block *sb, struct vfsmount *mnt)
+/* Register an old or new target with the MGS. If needed MGS will construct
+ startup logs and assign index */
+static int server_register_target(struct super_block *sb, struct vfsmount *mnt)
{
struct lustre_sb_info *lsi = s2lsi(sb);
struct obd_device *mgc = lsi->lsi_mgc;
LASSERT(mgc);
- /* send MGS_TARGET_ADD rpc via MGC, MGS should reply with an
- index number. */
-
OBD_ALLOC(mti, sizeof(*mti));
if (!mti) {
RETURN(-ENOMEM);
mti->mti_stripe_size = ldd->ldd_stripe_sz;
mti->mti_stripe_offset = ldd->ldd_stripe_offset;
- CDEBUG(D_MOUNT, "Initial registration %s, fs=%s, %s, index=%04x\n",
+ CDEBUG(D_MOUNT, "%sregistration %s, fs=%s, %s, index=%04x, flags=%#x\n",
+ mti->mti_flags & LDD_F_NEED_REGISTER ? "Initial " : "",
mti->mti_svname, mti->mti_fsname,
- libcfs_nid2str(mti->mti_nids[0]), mti->mti_stripe_index);
+ libcfs_nid2str(mti->mti_nids[0]), mti->mti_stripe_index,
+ mti->mti_flags);
/* Register the target */
/* FIXME use mdc_process_config instead */
rc = obd_set_info(mgc->u.cli.cl_mgc_mgsexp,
strlen("add_target"), "add_target",
sizeof(*mti), mti);
- CDEBUG(D_MOUNT, "disconnect");
if (rc) {
- CERROR("add_target failed %d\n", rc);
+ CERROR("registration with the MGS failed (%d)\n", rc);
GOTO(out, rc);
}
- /* If this flag is still set, it means we need to change our on-disk
- index to what the mgs assigned us. */
- if (mti->mti_flags & LDD_F_NEED_INDEX) {
+ /* If this flag is set, it means the MGS wants us to change our
+ on-disk data. (So far this means just the index.) */
+ if (mti->mti_flags & LDD_F_REWRITE) {
CDEBUG(D_MOUNT, "Must change on-disk index from %#x to %#x for "
" %s\n",
ldd->ldd_svindex, mti->mti_stripe_index,
strncpy(ldd->ldd_svname, mti->mti_svname,
sizeof(ldd->ldd_svname));
/* or ldd_make_sv_name(ldd); */
+ ldd->ldd_flags = mti->mti_flags & ~LDD_F_REWRITE;
+ ldd_write(&mgc->obd_lvfs_ctxt, ldd);
+
/* FIXME write last_rcvd?, disk label? */
- mti->mti_flags &= ~LDD_F_NEED_INDEX;
}
- /* Always write out the new flags */
- ldd->ldd_flags = mti->mti_flags;
- ldd_write(&mgc->obd_lvfs_ctxt, ldd);
-
out:
if (mti)
OBD_FREE(mti, sizeof(*mti));
to read and write configs locally. */
server_mgc_set_fs(lsi->lsi_mgc, sb);
- /* Register if needed */
- if (lsi->lsi_ldd->ldd_flags &
- (LDD_F_NEED_INDEX | LDD_F_NEED_REGISTER | LDD_F_UPGRADE14)) {
- CDEBUG(D_MOUNT, "Need new target index from MGS\n");
- rc = server_add_target(sb, mnt);
- if (rc) {
- CERROR("Initial connect failed for %s: %d\n",
- lsi->lsi_ldd->ldd_svname, rc);
- GOTO(out, rc);
- }
+ /* Register with MGS */
+ rc = server_register_target(sb, mnt);
+ if (rc && (lsi->lsi_ldd->ldd_flags &
+ (LDD_F_NEED_INDEX | LDD_F_NEED_REGISTER | LDD_F_UPGRADE14))){
+ CERROR("Required refistration failed for %s: %d\n",
+ lsi->lsi_ldd->ldd_svname, rc);
+ GOTO(out, rc);
}
if (class_name2obd(lsi->lsi_ldd->ldd_svname)) {
LIBPTLCTL := $(top_builddir)/lnet/utils/libptlctl.a
-sbin_scripts = lconf lmc llanalyze llstat.pl llobdstat.pl lactive \
+sbin_scripts = llanalyze llstat.pl llobdstat.pl lactive \
load_ldap.sh lrun
bin_scripts = lfind lstripe
if UTILS
-rootsbin_SCRIPTS =
+# mount only finds helpers in /sbin
+rootsbin_PROGRAMS = mount.lustre
sbin_PROGRAMS = lctl obdio obdbarrier lload wirecheck wiretest \
- mount_lustre mount.lustre mkfs_lustre mkfs.lustre \
- tunefs_lustre tunefs.lustre l_getgroups
-bin_PROGRAMS = lfs llog_reader
+ mount_lustre mkfs_lustre mkfs.lustre \
+ tunefs_lustre tunefs.lustre l_getgroups llog_reader
+bin_PROGRAMS = lfs
lib_LIBRARIES = liblustreapi.a
sbin_SCRIPTS = $(sbin_scripts)
bin_SCRIPTS = $(bin_scripts)
cp wirehdr.c wiretest.c
./wirecheck >> wiretest.c
+# Apparently I can't use .'s in automake names
mount.lustre$(EXEEXT): mount_lustre
cp $< $@
"\t\t--reformat: overwrite an existing disk\n"
#else
"\t\t--nomgs: turn off MGS service on this MDT\n"
+ "\t\t--writeconf: erase all config logs for this fs.\n"
#endif
"\t\t--print: just report what we would do; don't write to "
"disk\n"
{"index", 1, 0, 'i'},
{"timeout", 1, 0, 't'},
{"verbose", 0, 0, 'v'},
+ {"writeconf", 1, 0, 'w'},
{0, 0, 0, 0}
};
char *optstring = "b:C:d:n:f:hI:MGm:k:No:Opqrw:c:s:i:t:v";
case 'v':
verbose++;
break;
+ case 'w':
+ mop->mo_ldd.ldd_flags |= LDD_F_WRITECONF;
+ break;
default:
if (opt != '?') {
fatal();
usage(stderr);
}
- if (verbose) {
+ if (verbose > 1) {
for (i = 0; i < argc; i++)
printf("arg[%d] = %s\n", i, argv[i]);
printf("source = %s, target = %s\n", source, target);