From 486da95ea184c8e004b7cf6179c59e07f7433edf Mon Sep 17 00:00:00 2001 From: anserper Date: Wed, 24 Dec 2008 17:03:46 +0000 Subject: [PATCH] b=18083 i=Yong Fan i=Andrew Perepechko Force current op. quota files format for MDS op. quota files --- lustre/quota/quota_ctl.c | 4 ++++ lustre/quota/quota_master.c | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/lustre/quota/quota_ctl.c b/lustre/quota/quota_ctl.c index ebdb535..b7e4aee 100644 --- a/lustre/quota/quota_ctl.c +++ b/lustre/quota/quota_ctl.c @@ -67,6 +67,7 @@ int mds_quota_ctl(struct obd_export *exp, struct obd_quotactl *oqctl) { struct obd_device *obd = exp->exp_obd; + struct obd_device_target *obt = &obd->u.obt; struct lustre_quota_ctxt *qctxt = &obd->u.obt.obt_qctxt; struct timeval work_start; struct timeval work_end; @@ -77,9 +78,11 @@ int mds_quota_ctl(struct obd_export *exp, struct obd_quotactl *oqctl) do_gettimeofday(&work_start); switch (oqctl->qc_cmd) { case Q_QUOTAON: + oqctl->qc_id = obt->obt_qfmt; /* override qfmt version */ rc = mds_quota_on(obd, oqctl); break; case Q_QUOTAOFF: + oqctl->qc_id = obt->obt_qfmt; /* override qfmt version */ mds_quota_off(obd, oqctl); break; case Q_SETINFO: @@ -102,6 +105,7 @@ int mds_quota_ctl(struct obd_export *exp, struct obd_quotactl *oqctl) rc = mds_quota_invalidate(obd, oqctl); break; case LUSTRE_Q_FINVALIDATE: + oqctl->qc_id = obt->obt_qfmt; /* override qfmt version */ rc = mds_quota_finvalidate(obd, oqctl); break; default: diff --git a/lustre/quota/quota_master.c b/lustre/quota/quota_master.c index ea71dcb..adcdd3c 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -662,7 +662,6 @@ int mds_quota_finvalidate(struct obd_device *obd, struct obd_quotactl *oqctl) down(&mds->mds_qonoff_sem); oqctl->qc_cmd = Q_FINVALIDATE; - oqctl->qc_id = obd->u.obt.obt_qfmt; rc = fsfilt_quotactl(obd, obd->u.obt.obt_sb, oqctl); if (!rc) rc = obd_quotactl(mds->mds_osc_exp, oqctl); @@ -900,15 +899,16 @@ int mds_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl) push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); rc = mds_admin_quota_on(obd, oqctl); if (rc) - goto out; - - rc = obd_quotactl(mds->mds_osc_exp, oqctl); - if (rc) - goto out; + GOTO(out, rc); rc = fsfilt_quotactl(obd, obd->u.obt.obt_sb, oqctl); if (!rc) obt->obt_qctxt.lqc_flags |= UGQUOTA2LQC(oqctl->qc_type); + else + GOTO(out, rc); + + rc = obd_quotactl(mds->mds_osc_exp, oqctl); + out: pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); up(&mds->mds_qonoff_sem); -- 1.8.3.1