From bc60e9e0608e0afbda9e1439bf98730a83a5bb87 Mon Sep 17 00:00:00 2001 From: tianzy Date: Tue, 6 Jan 2009 04:17:14 +0000 Subject: [PATCH] Branch HEAD Enforce op. quota file format for MDS too b=18083 i=Yong Fan --- 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 826e9e5..5e8cd88 100644 --- a/lustre/quota/quota_ctl.c +++ b/lustre/quota/quota_ctl.c @@ -67,6 +67,7 @@ int mds_quota_ctl(struct obd_device *obd, struct obd_export *unused, struct obd_quotactl *oqctl) { + 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_device *obd, struct obd_export *unused, 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 */ rc = mds_quota_off(obd, oqctl); break; case Q_SETINFO: @@ -102,6 +105,7 @@ int mds_quota_ctl(struct obd_device *obd, struct obd_export *unused, 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 20b91f9..9629357 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -658,7 +658,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); @@ -863,15 +862,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