From bca470a9579d27433974ff819b6ac18960ef0000 Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Mon, 4 Feb 2013 01:56:04 -0500 Subject: [PATCH] LU-2548 quota: don't apply migration on global index copy Quota migration shouldn't be applied on the global index copy of quota slave on mdt. Signed-off-by: Niu Yawei Change-Id: I9f36b79e867ede20562223765dfc56358a4f3831 Reviewed-on: http://review.whamcloud.com/5259 Tested-by: Hudson Tested-by: Maloo Reviewed-by: Fan Yong Reviewed-by: Johann Lombardi --- lustre/osd-ldiskfs/osd_handler.c | 3 ++- lustre/osd-ldiskfs/osd_quota.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 1b3c323..825ce4d 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -2953,7 +2953,8 @@ static int osd_index_try(const struct lu_env *env, struct dt_object *dt, } LINVRNT(osd_invariant(obj)); - if (is_quota_glb_feat(feat)) + if (result == 0 && is_quota_glb_feat(feat) && + fid_seq(lu_object_fid(&dt->do_lu)) == FID_SEQ_QUOTA_GLB) result = osd_quota_migration(env, dt, feat); return result; diff --git a/lustre/osd-ldiskfs/osd_quota.c b/lustre/osd-ldiskfs/osd_quota.c index 9e16533..bfab83a 100644 --- a/lustre/osd-ldiskfs/osd_quota.c +++ b/lustre/osd-ldiskfs/osd_quota.c @@ -857,6 +857,8 @@ static int truncate_quota_index(const struct lu_env *env, struct dt_object *dt, int rc; ENTRY; + LASSERT(fid_seq(lu_object_fid(&dt->do_lu)) == FID_SEQ_QUOTA_GLB); + OBD_ALLOC_PTR(attr); if (attr == NULL) RETURN(-ENOMEM); -- 1.8.3.1