The global index version should be bumped to 2 if migration
happened, otherwise, the global index copy version on slave will
be same as the global index's (both equal to 1 after creation),
and the migrated limits will fail to be reintegrated.
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I2d596a33e2eb4495dfbb7bd63d37199297a9b214
Reviewed-on: http://review.whamcloud.com/4969
Reviewed-by: Johann Lombardi <johann.lombardi@intel.com>
Tested-by: Hudson
Reviewed-by: Fan Yong <fan.yong@intel.com>
Tested-by: Maloo <whamcloud.maloo@gmail.com>
}
static int set_quota_index_version(const struct lu_env *env,
}
static int set_quota_index_version(const struct lu_env *env,
+ struct dt_object *dt,
+ dt_obj_version_t version)
{
struct osd_device *osd = osd_obj2dev(osd_dt_obj(dt));
struct thandle *th;
{
struct osd_device *osd = osd_obj2dev(osd_dt_obj(dt));
struct thandle *th;
GOTO(out, rc);
th->th_sync = 1;
GOTO(out, rc);
th->th_sync = 1;
- dt_version_set(env, dt, 1, th);
+ dt_version_set(env, dt, version, th);
out:
dt_trans_stop(env, &osd->od_dt_dev, th);
RETURN(rc);
out:
dt_trans_stop(env, &osd->od_dt_dev, th);
RETURN(rc);
PFID(lu_object_fid(&dt->do_lu)), rc);
}
PFID(lu_object_fid(&dt->do_lu)), rc);
}
- /* bump index version to 1, so the migration will be skipped
- * next time. */
+ /* bump index version to 1 (or 2 if migration happened), so the
+ * migration will be skipped next time. */
- rc = set_quota_index_version(env , dt);
+ rc = set_quota_index_version(env , dt, converted ? 2 : 1);
if (rc)
CERROR("%s: Failed to set quota index("DFID") "
"version, rc:%d\n", osd->od_svname,
if (rc)
CERROR("%s: Failed to set quota index("DFID") "
"version, rc:%d\n", osd->od_svname,