From 1580b663d3c4303b59cc7af161e70a0b50badb89 Mon Sep 17 00:00:00 2001 From: Andrew Perepechko Date: Wed, 3 Feb 2010 20:13:59 +0300 Subject: [PATCH] b=21147 call build_lqs only from generic_quota_on i=Johann Lombardi i=ZhiYong Tian --- lustre/quota/lproc_quota.c | 11 ++++++----- lustre/quota/quota_ctl.c | 4 ---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/lustre/quota/lproc_quota.c b/lustre/quota/lproc_quota.c index 425b4f5..cbef63d 100644 --- a/lustre/quota/lproc_quota.c +++ b/lustre/quota/lproc_quota.c @@ -279,7 +279,6 @@ int generic_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl, int glo push_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); /* turn on local quota */ rc = fsfilt_quotactl(obd, obt->obt_sb, oqctl); - pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); if (rc) { if (rc != -ENOENT) CERROR("%s: %s quotaon failed with" @@ -287,7 +286,11 @@ int generic_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl, int glo global ? "global" : "local", rc); } else { obt->obt_qctxt.lqc_flags |= UGQUOTA2LQC(oqctl->qc_type); + /* when quotaon, create lqs for every + * quota uid/gid b=18574 */ + build_lqs(obd); } + pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); } if (rc == 0 && global && is_master) @@ -439,15 +442,13 @@ int lprocfs_quota_wr_type(struct file *file, const char *buffer, if (type != 0) { int rc = auto_quota_on(obd, type - 1); - if (rc == 0) - build_lqs(obd); - else if (rc == -ENOENT) + if (rc == -ENOENT) CWARN("%s: quotaon failed because quota files don't " "exist, please run quotacheck firstly\n", obd->obd_name); else if (rc == -EALREADY) CWARN("%s: quota is on already!\n", obd->obd_name); - else + else if (rc != 0) return rc; } diff --git a/lustre/quota/quota_ctl.c b/lustre/quota/quota_ctl.c index afc0b0d..5652b3d 100644 --- a/lustre/quota/quota_ctl.c +++ b/lustre/quota/quota_ctl.c @@ -129,8 +129,6 @@ int mds_quota_ctl(struct obd_export *exp, struct obd_quotactl *oqctl) switch (oqctl->qc_cmd) { case Q_QUOTAON: rc = mds_quota_on(obd, oqctl); - /* when quotaon, create lqs for every quota uid/gid b=18574 */ - build_lqs(obd); break; case Q_QUOTAOFF: oqctl->qc_id = obt->obt_qfmt; /* override qfmt version */ @@ -195,8 +193,6 @@ int filter_quota_ctl(struct obd_export *exp, struct obd_quotactl *oqctl) case Q_QUOTAON: oqctl->qc_id = obt->obt_qfmt; rc = generic_quota_on(obd, oqctl, 0); - /* when quotaon, create lqs for every quota uid/gid b=18574 */ - build_lqs(obd); break; case Q_FINVALIDATE: case Q_QUOTAOFF: -- 1.8.3.1