OBD_ALLOC(tmp->nid_brw_stats, sizeof(struct brw_stats));
if (tmp->nid_brw_stats == NULL)
- RETURN(-ENOMEM);
+ GOTO(clean, rc = -ENOMEM);
init_brw_stats(tmp->nid_brw_stats);
rc = lprocfs_seq_create(exp->exp_nid_stats->nid_proc, "brw_stats",
rc = lprocfs_init_rw_stats(obd, &exp->exp_nid_stats->nid_stats);
if (rc)
- RETURN(rc);
+ GOTO(clean, rc);
rc = lprocfs_register_stats(tmp->nid_proc, "stats",
tmp->nid_stats);
if (rc)
- RETURN(rc);
+ GOTO(clean, rc);
/* Always add in ldlm_stats */
tmp->nid_ldlm_stats =
lprocfs_alloc_stats(LDLM_LAST_OPC - LDLM_FIRST_OPC,
LPROCFS_STATS_FLAG_NOPERCPU);
if (tmp->nid_ldlm_stats == NULL)
- return -ENOMEM;
+ GOTO(clean, rc = -ENOMEM);
lprocfs_init_ldlm_stats(tmp->nid_ldlm_stats);
rc = lprocfs_register_stats(tmp->nid_proc, "ldlm_stats",
tmp->nid_ldlm_stats);
if (rc)
- RETURN(rc);
+ GOTO(clean, rc);
}
RETURN(0);
+ clean:
+ lprocfs_exp_cleanup(exp);
+ return rc;
}
/* Add client data to the FILTER. We use a bitmap to locate a free space
obd_id id;
LASSERT(filter->fo_fsd != NULL);
LASSERT(group <= filter->fo_group_count);
+ LASSERT(filter->fo_last_objids != NULL);
/* FIXME: object groups */
cfs_spin_lock(&filter->fo_objidlock);
}
label = fsfilt_get_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 "
- "recovery for at least %d:%.02d, or until %d "
- "client%s reconnect%s.\n",
- obd->obd_name, lustre_cfg_string(lcfg, 1),
- label ?: "", label ? "/" : "", str,
+ LCONSOLE_INFO("%s: Now serving %s %s%s with recovery %s\n",
+ obd->obd_name, label ?: str, lmi ? "on " : "",
+ lmi ? s2lsi(lmi->lmi_sb)->lsi_lmd->lmd_dev : "",
+ obd->obd_replayable ? "enabled" : "disabled");
+
+ if (obd->obd_recovering)
+ LCONSOLE_WARN("%s: Will be in recovery for at least %d:%.02d, "
+ "or until %d client%s reconnect%s\n",
+ obd->obd_name,
obd->obd_recovery_timeout / 60,
obd->obd_recovery_timeout % 60,
obd->obd_max_recoverable_clients,
- (obd->obd_max_recoverable_clients == 1) ? "":"s",
- (obd->obd_max_recoverable_clients == 1) ? "s":"");
- } else {
- LCONSOLE_INFO("OST %s now serving %s (%s%s%s) with recovery "
- "%s\n", obd->obd_name, lustre_cfg_string(lcfg, 1),
- label ?: "", label ? "/" : "", str,
- obd->obd_replayable ? "enabled" : "disabled");
- }
+ (obd->obd_max_recoverable_clients == 1) ? "" : "s",
+ (obd->obd_max_recoverable_clients == 1) ? "s": "");
+
RETURN(0);
fed->fed_lcd = NULL;
}
class_disconnect(lexp);
+ lprocfs_exp_cleanup(lexp);
*exp = NULL;
} else {
*exp = lexp;
filter = &exp->exp_obd->u.filter;
push_ctxt(&saved, &exp->exp_obd->obd_lvfs_ctxt, NULL);
+ /*
+ * We need to be atomic against a concurrent write
+ * (which takes the semaphore for reading). fmd_mactime_xid
+ * checks will have no effect if a write request with lower
+ * xid starts just before a setattr and finishes later than
+ * the setattr (see bug 21489, comment 27).
+ */
if (oa->o_valid &
(OBD_MD_FLMTIME | OBD_MD_FLATIME | OBD_MD_FLCTIME)) {
+ down_write(&dentry->d_inode->i_alloc_sem);
fmd = filter_fmd_get(exp, oa->o_id, oa->o_gr);
if (fmd && fmd->fmd_mactime_xid < oti->oti_xid)
fmd->fmd_mactime_xid = oti->oti_xid;
filter_fmd_put(exp, fmd);
+ up_write(&dentry->d_inode->i_alloc_sem);
}
/* setting objects attributes (including owner/group) */