/* Don't wait for mds_postrecov trying to clear orphans */
obd->obd_async_recov = 1;
rc = mds_postsetup(obd);
+ obd->obd_async_recov = 0;
if (rc)
GOTO(err_qctxt, rc);
- obd->obd_async_recov = 0;
lprocfs_init_vars(mds, &lvars);
lprocfs_obd_setup(obd, lvars.obd_vars);
mds->mds_max_mdsize = lov_mds_md_size(stripes);
mds->mds_max_cookiesize = stripes * sizeof(struct llog_cookie);
- CDEBUG(D_HA, "updated max_mdsize/max_cookiesize: %d/%d\n",
+ CDEBUG(D_HA|D_WARNING, "updated max_mdsize/max_cookiesize: %d/%d\n",
mds->mds_max_mdsize, mds->mds_max_cookiesize);
out:
if (rc)
RETURN(rc);
- /* idx is set as data from lov_notify. In the recovery case, this
- is not set. */
- if (idx != MDSLOV_NO_INDEX) {
+ CDEBUG(D_ERROR, "idx=%d, recov=%d/%d, cnt=%d/%d\n",
+ idx, obd->obd_recovering, obd->obd_async_recov, old_count,
+ mds->mds_lov_desc.ld_tgt_count);
+
+ /* idx is set as data from lov_notify. */
+ if (idx != MDSLOV_NO_INDEX && !obd->obd_recovering) {
if (idx >= mds->mds_lov_desc.ld_tgt_count) {
CERROR("index %d > count %d!\n", idx,
mds->mds_lov_desc.ld_tgt_count);
}
/* If we added a target we have to reconnect the llogs */
- if (idx != MDSLOV_NO_INDEX ||
- mds->mds_lov_desc.ld_tgt_count > old_count) {
- CDEBUG(D_CONFIG, "reset llogs idx=%d\n", idx);
+ /* Only do this at first add (idx), or the first time after recovery */
+ if (idx != MDSLOV_NO_INDEX || 1/*FIXME*/) {
+ CDEBUG(D_CONFIG|D_WARNING, "reset llogs idx=%d\n", idx);
/* These two must be atomic */
down(&mds->mds_orphan_recovery_sem);
obd_llog_finish(obd, old_count);
GOTO(out, rc);
}
- EXIT;
out:
class_decref(obd);
- return rc;
+ RETURN(rc);
}
int mds_lov_synchronize(void *data)
RETURN(0);
}
- CDEBUG(D_WARNING, "notify %s ev=%d\n", watched->obd_name, ev);
+ CDEBUG(D_CONFIG, "notify %s ev=%d\n", watched->obd_name, ev);
if (strcmp(watched->obd_type->typ_name, LUSTRE_OSC_NAME) != 0) {
CERROR("unexpected notification of %s %s!\n",
}
if (obd->obd_recovering) {
- /* if MDT is in recovery we do not reinit desc and
- easize, as that will be done in mds_postrecov() after
- recovery is finished. */
CWARN("MDS %s: in recovery, not resetting orphans on %s\n",
obd->obd_name,
watched->u.cli.cl_import->imp_target_uuid.uuid);
+ /* We still have to fix the lov descriptor for ost's added
+ after the mdt in the config log. They didn't make it into
+ mds_lov_connect. */
+ rc = mds_lov_update_desc(obd, obd->u.mds.mds_osc_exp);
RETURN(rc);
- }
+ }
LASSERT(llog_get_context(obd, LLOG_MDS_OST_ORIG_CTXT) != NULL);
rc = mds_lov_start_synchronize(obd, watched, data,
!(ev == OBD_NOTIFY_SYNC));
+
lquota_recovery(quota_interface, obd);
RETURN(rc);
struct obd_trans_info oti = { 0 };
struct lov_stripe_md *lsm = NULL;
struct lov_mds_md *lmm = NULL;
- int rc, lmm_bufsize, lmm_size;
+ int rc, lmm_size;
struct mds_body *body;
struct obdo *oa;
void *lmm_buf;
mds_objids_from_lmm(*ids, lmm, &mds->mds_lov_desc);
- lmm_buf = lustre_msg_buf(req->rq_repmsg, offset, 0);
- lmm_bufsize = req->rq_repmsg->buflens[offset];
- LASSERT(lmm_buf);
- LASSERT(lmm_bufsize >= lmm_size);
- memcpy(lmm_buf, lmm, lmm_size);
rc = fsfilt_set_md(obd, inode, *handle, lmm, lmm_size, "lov");
+ lmm_buf = lustre_msg_buf(req->rq_repmsg, offset, lmm_size);
+ if (!lmm_buf) {
+ if (!rc) rc = -ENOMEM;
+ } else {
+ memcpy(lmm_buf, lmm, lmm_size);
+ }
if (rc)
CERROR("open replay failed to set md:%d\n", rc);
- RETURN(0);
+ RETURN(rc);
}
if (OBD_FAIL_CHECK_ONCE(OBD_FAIL_MDS_ALLOC_OBDO))
rc = fsfilt_set_md(obd, inode, *handle, lmm, lmm_size, "lov");
lmm_buf = lustre_msg_buf(req->rq_repmsg, offset, lmm_size);
- if (!lmm_buf)
- rc = -ENOMEM;
- else
+ if (!lmm_buf) {
+ if (!rc) rc = -ENOMEM;
+ } else {
memcpy(lmm_buf, lmm, lmm_size);
+ }
obd_free_diskmd(mds->mds_osc_exp, &lmm);
out_oa:
oti_free_cookies(&oti);
# define EXPORT_SYMTAB
#endif
#define DEBUG_SUBSYSTEM S_MGC
-#define D_MGC D_CONFIG|D_WARNING
+#define D_MGC D_CONFIG/*|D_WARNING*/
#ifdef __KERNEL__
# include <linux/module.h>
spin_unlock(&config_list_lock);
/* drop the start ref */
config_log_put(cld);
- CDEBUG(D_MGC, "end config log %s (%d)\n", logname, rc);
+ CDEBUG(D_MGC, "end config log %s (%d)\n", logname ? logname : "client",
+ rc);
RETURN(rc);
}
# define EXPORT_SYMTAB
#endif
#define DEBUG_SUBSYSTEM S_MGS
-#define D_MGS D_CONFIG|D_WARNING
+#define D_MGS D_CONFIG/*|D_WARNING*/
#ifdef __KERNEL__
# include <linux/module.h>
#define EXPORT_SYMTAB
#endif
#define DEBUG_SUBSYSTEM S_MGS
-#define D_MGS D_CONFIG|D_WARNING
+#define D_MGS D_CONFIG/*|D_WARNING*/
#ifdef __KERNEL__
#include <linux/module.h>
name, rc);
GOTO(out, rc);
}
-
+
if (!S_ISREG(file->f_dentry->d_inode->i_mode)) {
CERROR("%s is not a regular file!: mode = %o\n", name,
file->f_dentry->d_inode->i_mode);
GOTO(out, rc = -ENOENT);
}
+ CERROR("cat list: disk size=%d, read=%d\n",
+ (int)file->f_dentry->d_inode->i_size, size);
+
rc = fsfilt_read_record(disk_obd, file, idarray, size, &off);
if (rc) {
- CDEBUG(D_INODE,"OBD filter: error reading %s: rc %d\n",
- name, rc);
+ CERROR("OBD filter: error reading %s: rc %d\n", name, rc);
GOTO(out, rc);
}
#define DEBUG_SUBSYSTEM S_MGMT
-#define D_MOUNT D_SUPER|D_CONFIG|D_WARNING
+#define D_MOUNT D_SUPER|D_CONFIG/*|D_WARNING*/
#define PRINT_CMD LCONSOLE
#define PRINT_MASK D_WARNING
if (endh)
*endh = endp;
- CDEBUG(D_WARNING, "Nid %s\n", libcfs_nid2str(*nid));
+ CDEBUG(D_MOUNT, "Nid %s\n", libcfs_nid2str(*nid));
return 0;
}
struct lustre_cfg_bufs bufs;
struct lustre_cfg * lcfg = NULL;
int rc;
-
- CDEBUG((cmd==LCFG_ADD_UUID)?D_WARNING:D_TRACE,
- "lcfg %s %#x %s %s %s %s\n", cfgname,
+ CDEBUG(D_TRACE, "lcfg %s %#x %s %s %s %s\n", cfgname,
cmd, s1, s2, s3, s4);
lustre_cfg_bufs_reset(&bufs, cfgname);