uuid->uuid[sizeof(*uuid) - 1] = '\0';
}
-static inline char *obd_uuid2str(struct obd_uuid *uuid)
-{
- return (char *)uuid->uuid;
-}
+/* If we're not null-terminated, crash here instead of in printf */
+#define obd_uuid2str(x) ( \
+ LASSERT((x)->uuid[sizeof(struct obd_uuid) - 1] == '\0'), \
+ (char *)(x)->uuid \
+)
#define LUSTRE_Q_QUOTAON 0x800002 /* turn quotas on */
#define LUSTRE_Q_QUOTAOFF 0x800003 /* turn quotas off */
CERROR("No profile found: %s\n", profilenm);
GOTO(out_free, err = -EINVAL);
}
- CERROR("Found profile %s: mdc=%s osc=%s\n", profilenm,
+ CDEBUG(D_CONFIG, "Found profile %s: mdc=%s osc=%s\n", profilenm,
lprof->lp_mdc, lprof->lp_osc);
OBD_ALLOC(osc, strlen(lprof->lp_osc) +
if (rc)
RETURN(rc);
- //FIXME remove D_ERROR
- CDEBUG(D_CONFIG | D_ERROR, "llog init with %d targets\n", count);
+ CDEBUG(D_CONFIG, "llog init with %d targets\n", count);
LASSERT(lov->desc.ld_tgt_count == count);
for (i = 0, ctgt = lov->tgts; i < lov->desc.ld_tgt_count; i++, ctgt++) {
struct obd_device *child;
&obd->obd_uuid);
if (!tgt_obd) {
- CERROR("Target %s not attached\n", tgt_uuid->uuid);
+ CERROR("Target %s not attached\n", obd_uuid2str(tgt_uuid));
RETURN(-EINVAL);
}
- CDEBUG(D_ERROR, "Connect tgt %s (%s)\n", (char *)tgt->uuid.uuid,
+ CDEBUG(D_CONFIG, "Connect tgt %s (%s)\n", obd_uuid2str(tgt_uuid),
tgt_obd->obd_name);
if (!tgt_obd->obd_set_up) {
- CERROR("Target %s not set up\n", tgt_uuid->uuid);
+ CERROR("Target %s not set up\n", obd_uuid2str(tgt_uuid));
RETURN(-EINVAL);
}
if (imp->imp_invalid) {
CERROR("not connecting OSC %s; administratively "
- "disabled\n", tgt_uuid->uuid);
+ "disabled\n", obd_uuid2str(tgt_uuid));
rc = obd_register_observer(tgt_obd, obd);
if (rc) {
CERROR("Target %s register_observer error %d; "
"will not be able to reactivate\n",
- tgt_uuid->uuid, rc);
+ obd_uuid2str(tgt_uuid), rc);
}
RETURN(0);
}
rc = obd_connect(&conn, tgt_obd, &lov_osc_uuid, data);
if (rc) {
- CERROR("Target %s connect error %d\n", tgt_uuid->uuid, rc);
+ CERROR("Target %s connect error %d\n",
+ obd_uuid2str(tgt_uuid), rc);
RETURN(rc);
}
tgt->ltd_exp = class_conn2export(&conn);
rc = obd_register_observer(tgt_obd, obd);
if (rc) {
CERROR("Target %s register_observer error %d\n",
- tgt_uuid->uuid, rc);
+ obd_uuid2str(tgt_uuid), rc);
obd_disconnect(tgt->ltd_exp);
tgt->ltd_exp = NULL;
RETURN(rc);
tgt = &lov->tgts[index];
if (!obd_uuid_empty(&tgt->uuid)) {
- CERROR("UUID %.40s already assigned at LOV target index %d\n",
+ CERROR("UUID %s already assigned at LOV target index %d\n",
obd_uuid2str(&tgt->uuid), index);
RETURN(-EEXIST);
}
has fewer targets. Old targets not in the lov descriptor
during mds setup may still have valid objids. */
size = mds->mds_lov_objid_filp->f_dentry->d_inode->i_size;
-
- CERROR("objid file size: %d\n", size);
if (size == 0)
RETURN(0);
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
- * Copyright (C) 2001-2005 Cluster File Systems, Inc.
- * Author Nathan <nathan@clusterfs.com>
- * Author LinSongTao <lincent@clusterfs.com>
+ * lustre/mgc/mgc_request.c
+ * Lustre Management Client config llog handling
+ *
+ * Copyright (C) 2006 Cluster File Systems, Inc.
+ * Author Nathan Rutman <nathan@clusterfs.com>
*
* This file is part of Lustre, http://www.lustre.org
*
* requests are coming * in over the wire, so object target modules
* do not have a full * method table.)
*/
+
#ifndef EXPORT_SYMTAB
# define EXPORT_SYMTAB
#endif
#define DEBUG_SUBSYSTEM S_MGC
-#define D_MGC D_CONFIG|D_ERROR
+#define D_MGC D_CONFIG|D_WARNING
#ifdef __KERNEL__
# include <linux/module.h>
struct client_obd *cli = &obd->u.cli;
struct dentry *dentry;
int err = 0;
+ ENTRY;
LASSERT(lsi);
LASSERT(lsi->lsi_srv_mnt == mnt);
obd->obd_fsops = fsfilt_get_ops(MT_STR(lsi->lsi_ldd));
if (IS_ERR(obd->obd_fsops)) {
- CERROR("No fstype %s rc=%ld\n", MT_STR(lsi->lsi_ldd),
- PTR_ERR(obd->obd_fsops));
- return(PTR_ERR(obd->obd_fsops));
+ up(&cli->cl_mgc_sem);
+ CERROR("No fstype %s rc=%ld\n", MT_STR(lsi->lsi_ldd),
+ PTR_ERR(obd->obd_fsops));
+ RETURN(PTR_ERR(obd->obd_fsops));
}
cli->cl_mgc_vfsmnt = mnt;
// FIXME which is the right SB? - filter_common_setup also
- CERROR("SB's: fill=%p mnt=%p root=%p\n", sb, mnt->mnt_sb,
+ CDEBUG(D_MGC, "SB's: fill=%p mnt=%p root=%p\n", sb, mnt->mnt_sb,
mnt->mnt_root->d_inode->i_sb);
- fsfilt_setup(obd, mnt->mnt_root->d_inode->i_sb);
+ fsfilt_setup(obd, mnt->mnt_sb);
OBD_SET_CTXT_MAGIC(&obd->obd_lvfs_ctxt);
obd->obd_lvfs_ctxt.pwdmnt = mnt;
obd->obd_lvfs_ctxt.pwd = mnt->mnt_root;
obd->obd_lvfs_ctxt.fs = get_ds();
- //obd->obd_lvfs_ctxt.cb_ops = mds_lvfs_ops;
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
dentry = lookup_one_len(MOUNT_CONFIGS_DIR, current->fs->pwd,
err = PTR_ERR(dentry);
CERROR("cannot lookup %s directory: rc = %d\n",
MOUNT_CONFIGS_DIR, err);
- goto err_ops;
+ GOTO(err_ops, err);
}
cli->cl_mgc_configs_dir = dentry;
/* We keep the cl_mgc_sem until mgc_fs_cleanup */
- return (0);
+ RETURN(0);
err_ops:
fsfilt_put_ops(obd->obd_fsops);
obd->obd_fsops = NULL;
cli->cl_mgc_vfsmnt = NULL;
up(&cli->cl_mgc_sem);
- return(err);
+ RETURN(err);
}
static int mgc_fs_cleanup(struct obd_device *obd)
{
struct client_obd *cli = &obd->u.cli;
int rc = 0;
+ ENTRY;
LASSERT(cli->cl_mgc_vfsmnt != NULL);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
}
- /* never got mount
- rc = server_put_mount(obd->obd_name, cli->cl_mgc_vfsmnt);
- if (rc)
- CERROR("mount_put failed %d\n", rc);
- */
-
cli->cl_mgc_vfsmnt = NULL;
-
if (obd->obd_fsops)
fsfilt_put_ops(obd->obd_fsops);
up(&cli->cl_mgc_sem);
-
- return(rc);
+ RETURN(rc);
}
static int mgc_cleanup(struct obd_device *obd)
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
- * mgs/mgs_fs.c
+ * lustre/mgs/mgs_fs.c
* Lustre Management Server (MGS) filesystem interface code
*
- * Copyright (C) 2002, 2003 Cluster File Systems, Inc.
- * Author: Nathan <nathan@clusterfs.com>
- * Author: LinSongtao <lincent@clusterfs.com>
+ * Copyright (C) 2006 Cluster File Systems, Inc.
+ * Author: Nathan Rutman <nathan@clusterfs.com>
*
* This file is part of Lustre, http://www.lustre.org.
*
push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
if (mgs->mgs_configs_dir) {
- CERROR("configs dir dcount=%d\n",
- atomic_read(&mgs->mgs_configs_dir->d_count));
+ /*CERROR("configs dir dcount=%d\n",
+ atomic_read(&mgs->mgs_configs_dir->d_count));*/
l_dput(mgs->mgs_configs_dir);
mgs->mgs_configs_dir = NULL;
}
shrink_dcache_parent(mgs->mgs_fid_de);
- CERROR("fid dir dcount=%d\n",
- atomic_read(&mgs->mgs_fid_de->d_count));
+ /*CERROR("fid dir dcount=%d\n",
+ atomic_read(&mgs->mgs_fid_de->d_count));*/
dput(mgs->mgs_fid_de);
pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL);
* lustre/mgs/mgs_handler.c
* Lustre Management Server (mgs) request handler
*
- * Copyright (C) 2001-2005 Cluster File Systems, Inc.
- * Author Nathan <nathan@clusterfs.com>
- * Author LinSongTao <lincent@clusterfs.com>
+ * Copyright (C) 2006 Cluster File Systems, Inc.
+ * Author: Nathan Rutman <nathan@clusterfs.com>
*
* This file is part of Lustre, http://www.lustre.org.
*
# define EXPORT_SYMTAB
#endif
#define DEBUG_SUBSYSTEM S_MGS
-#define D_MGS D_CONFIG|D_ERROR
+#define D_MGS D_CONFIG|D_WARNING
#ifdef __KERNEL__
# include <linux/module.h>
/* revoke the config lock so everyone will update */
lockrc = mgs_get_cfg_lock(obd, mti->mti_fsname, &lockh);
if (lockrc != ELDLM_OK) {
- LCONSOLE_ERROR("Can't signal other nodes to update "
+ LCONSOLE_ERROR("%s: Can't signal other nodes to update "
"their configuration (%d). Updating local logs "
"anyhow; you might have to manually restart "
"other nodes to get the latest configuration.\n",
- lockrc);
+ obd->obd_name, lockrc);
}
/* There can be only 1 server adding at a time - don't want log
if (mti->mti_flags & LDD_F_WRITECONF) {
rc = mgs_erase_logs(obd, mti->mti_fsname);
mti->mti_flags |= LDD_F_NEED_REGISTER;
- LCONSOLE_WARNING("Logs for fs %s were removed by user request. "
- "All servers must re-register in order to "
- "regenerate the client log.\n",
- mti->mti_fsname);
+ LCONSOLE_WARN("%s: Logs for fs %s were removed by user request."
+ " All servers must re-register in order to "
+ "regenerate the client log.\n",
+ obd->obd_name, mti->mti_fsname);
mti->mti_flags &= ~LDD_F_WRITECONF;
mti->mti_flags |= LDD_F_REWRITE;
}
rc = target_handle_disconnect(req);
req->rq_status = rc; /* superfluous? */
break;
-
case MGS_TARGET_ADD:
DEBUG_REQ(D_MGS, req, "target add\n");
rc = mgs_handle_target_add(req);
DEBUG_REQ(D_INFO, req, "ping");
rc = target_handle_ping(req);
break;
-
case OBD_LOG_CANCEL:
DEBUG_REQ(D_MGS, req, "log cancel\n");
OBD_FAIL_RETURN(OBD_FAIL_OBD_LOG_CANCEL_NET, 0);
* vim:expandtab:shiftwidth=8:tabstop=8:
*
* lustre/mgs/mgs_llog.c
- * Lustre Management Server (mgs) llog controller
+ * Lustre Management Server (mgs) config llog creation
*
- * Copyright (C) 2001-2005 Cluster File Systems, Inc.
+ * Copyright (C) 2006 Cluster File Systems, Inc.
+ * Author: Nathan Rutman <nathan@clusterfs.com>
*
* This file is part of Lustre, http://www.lustre.org.
*
#define EXPORT_SYMTAB
#endif
#define DEBUG_SUBSYSTEM S_MGS
-#define D_MGS D_CONFIG|D_ERROR
+#define D_MGS D_CONFIG|D_WARNING
#ifdef __KERNEL__
#include <linux/module.h>
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
- * Copyright (c) 2001-2003 Cluster File Systems, Inc.
+ * Copyright (c) 2001-2006 Cluster File Systems, Inc.
*
* This file is part of the Lustre file system, http://www.lustre.org
* Lustre is a trademark of Cluster File Systems, Inc.
rc = llog_process(llh, class_config_llog_handler, cfg, &cd);
- CDEBUG(D_CONFIG|D_ERROR, "Processed log %s gen %d-%d (%d)\n", name,
+ // FIXME remove warning
+ CDEBUG(D_CONFIG|D_WARNING, "Processed log %s gen %d-%d (%d)\n", name,
cd.first_idx + 1, cd.last_idx, rc);
if (cfg)
cfg->cfg_last_idx = cd.last_idx;
/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
*
- * lustre/lvfs/lvfs_mount.c
+ * lustre/obdclass/obd_mount.c
* Client/server mount routines
*
- * Copyright (c) 2005 Cluster File Systems, Inc.
+ * Copyright (c) 2006 Cluster File Systems, Inc.
* Author: Nathan Rutman <nathan@clusterfs.com>
*
* This file is part of Lustre, http://www.lustre.org/
/**************** config llog ********************/
/* Get a config log from the MGS and process it.
- This func is called for both clients and servers. */
+ This func is called for both clients and servers.
+ Continue to process new statements appended to the logs
+ (whenever the config lock is revoked) until lustre_end_log
+ is called. */
int lustre_process_log(struct super_block *sb, char *logname,
struct config_llog_instance *cfg)
{
RETURN(rc);
}
-
+/* Stop watching this config log for updates */
int lustre_end_log(struct super_block *sb, char *logname,
struct config_llog_instance *cfg)
{
CDEBUG(D_MOUNT, "server put_super %s\n", lsi->lsi_ldd->ldd_svname);
- /* tell the mgc to drop the config log */
- lustre_end_log(sb, lsi->lsi_ldd->ldd_svname, NULL);
+ /* Stop the target */
+ if (IS_MDT(lsi->lsi_ldd) || IS_OST(lsi->lsi_ldd)) {
- obd = class_name2obd(lsi->lsi_ldd->ldd_svname);
- if (obd) {
- CDEBUG(D_MOUNT, "stopping %s\n", obd->obd_name);
- if (lsi->lsi_flags & LSI_UMOUNT_FORCE)
+ /* tell the mgc to drop the config log */
+ lustre_end_log(sb, lsi->lsi_ldd->ldd_svname, NULL);
+
+ obd = class_name2obd(lsi->lsi_ldd->ldd_svname);
+ if (obd) {
+ CDEBUG(D_MOUNT, "stopping %s\n", obd->obd_name);
+ if (lsi->lsi_flags & LSI_UMOUNT_FORCE)
+ obd->obd_force = 1;
+ if (lsi->lsi_flags & LSI_UMOUNT_FAILOVER)
+ obd->obd_fail = 1;
+ /* We can't seem to give an error return code
+ to .put_super, so we better make sure we clean up!
+ FIXME is there a way to get around this? */
obd->obd_force = 1;
- if (lsi->lsi_flags & LSI_UMOUNT_FAILOVER)
- obd->obd_fail = 1;
- /* We can't seem to give an error return code
- to .put_super, so we better make sure we clean up!
- FIXME is there a way to get around this? */
- obd->obd_force = 1;
- class_manual_cleanup(obd);
- } else {
- CERROR("no obd %s\n", lsi->lsi_ldd->ldd_svname);
- server_deregister_mount(lsi->lsi_ldd->ldd_svname);
+ class_manual_cleanup(obd);
+ } else {
+ CERROR("no obd %s\n", lsi->lsi_ldd->ldd_svname);
+ server_deregister_mount(lsi->lsi_ldd->ldd_svname);
+ }
}
+ /* Stop the servers (MDS, OSS) if no longer needed */
server_stop_servers(sb);
/* If they wanted the mgs to stop separately from the mdt, they
label = fsfilt_label(obd, obd->u.obt.obt_sb);
if (obd->obd_recovering) {
- LCONSOLE_WARN("OST %s now serving %s (%s%s%s), but will be in"
+ LCONSOLE_WARN("OST %s now serving %s (%s%s%s), but will be in "
"recovery until %d %s reconnect, or if no clients"
" reconnect for %d:%.02d; during that time new "
"clients will not be allowed to connect. "