* Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2012, 2014 Intel Corporation.
+ * Copyright (c) 2012, 2015, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
struct lu_device *d;
struct ofd_thread_info *info = ofd_info(env);
struct lustre_mount_info *lmi;
+ struct lustre_mount_data *lmd;
int rc;
char *osdname;
RETURN(-ENODEV);
}
+ lmd = s2lsi(lmi->lmi_sb)->lsi_lmd;
+ if (lmd != NULL && lmd->lmd_flags & LMD_FLG_SKIP_LFSCK)
+ m->ofd_skip_lfsck = 1;
+
/* find bottom osd */
OBD_ALLOC(osdname, MTI_NAME_MAXLEN);
if (osdname == NULL)
struct ofd_seq *oseq;
int rc = 0, diff;
int sync_trans = 0;
+ long granted = 0;
ENTRY;
if (!(oa->o_valid & OBD_MD_FLFLAGS) ||
!(oa->o_flags & OBD_FL_DELORPHAN)) {
/* don't enforce grant during orphan recovery */
- rc = ofd_grant_create(tsi->tsi_env,
- ofd_obd(ofd)->obd_self_export,
- &diff);
- if (rc) {
+ granted = ofd_grant_create(tsi->tsi_env,
+ ofd_obd(ofd)->obd_self_export,
+ &diff);
+ if (granted < 0) {
+ rc = granted;
+ granted = 0;
CDEBUG(D_HA, "%s: failed to acquire grant "
"space for precreate (%d): rc = %d\n",
ofd_name(ofd), diff, rc);
* LFSCK will eventually clean up any orphans. LU-14 */
if (diff > 5 * OST_MAX_PRECREATE) {
diff = OST_MAX_PRECREATE / 2;
- LCONSOLE_WARN("%s: precreate FID "DOSTID" is over %u "
- "larger than the LAST_ID "DOSTID", only "
- "precreating the last %u objects.\n",
- ofd_name(ofd), POSTID(&oa->o_oi),
- 5 * OST_MAX_PRECREATE,
- POSTID(&oseq->os_oi), diff);
+ LCONSOLE_WARN("%s: Too many FIDs to precreate "
+ "OST replaced or reformatted: "
+ "LFSCK will clean up",
+ ofd_name(ofd));
+
+ CDEBUG(D_HA, "%s: precreate FID "DOSTID" is over "
+ "%u larger than the LAST_ID "DOSTID", only "
+ "precreating the last %u objects.\n",
+ ofd_name(ofd), POSTID(&oa->o_oi),
+ 5 * OST_MAX_PRECREATE,
+ POSTID(&oseq->os_oi), diff);
ofd_seq_last_oid_set(oseq, ostid_id(&oa->o_oi) - diff);
}
ofd_name(ofd), rc);
if (!(oa->o_valid & OBD_MD_FLFLAGS) ||
- !(oa->o_flags & OBD_FL_DELORPHAN))
- ofd_grant_commit(tsi->tsi_env,
- ofd_obd(ofd)->obd_self_export, rc);
+ !(oa->o_flags & OBD_FL_DELORPHAN)) {
+ ofd_grant_commit(ofd_obd(ofd)->obd_self_export, granted,
+ rc);
+ granted = 0;
+ }
ostid_set_id(&rep_oa->o_oi, ofd_seq_last_oid(oseq));
}
info = ofd_info_init(env, NULL);
if (info == NULL)
- RETURN(-EFAULT);
+ GOTO(err_fini_proc, rc = -EFAULT);
rc = ofd_stack_init(env, m, cfg);
if (rc) {