From 92c9855dfc4300a1559312b6f8c5423fc2c6846c Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Tue, 8 Jan 2013 05:39:56 -0500 Subject: [PATCH 1/1] LU-2587 quota: bump version after migration 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 Change-Id: I2d596a33e2eb4495dfbb7bd63d37199297a9b214 Reviewed-on: http://review.whamcloud.com/4969 Reviewed-by: Johann Lombardi Tested-by: Hudson Reviewed-by: Fan Yong Tested-by: Maloo --- lustre/osd-ldiskfs/osd_quota.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lustre/osd-ldiskfs/osd_quota.c b/lustre/osd-ldiskfs/osd_quota.c index 2d3c80c..acf5557 100644 --- a/lustre/osd-ldiskfs/osd_quota.c +++ b/lustre/osd-ldiskfs/osd_quota.c @@ -906,7 +906,8 @@ out: } static int set_quota_index_version(const struct lu_env *env, - struct dt_object *dt) + struct dt_object *dt, + dt_obj_version_t version) { struct osd_device *osd = osd_obj2dev(osd_dt_obj(dt)); struct thandle *th; @@ -926,7 +927,7 @@ static int set_quota_index_version(const struct lu_env *env, 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); @@ -1064,10 +1065,10 @@ out: 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. */ if (rc == 0) { - 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, -- 1.8.3.1