From: Landen Date: Fri, 17 Dec 2010 06:46:28 +0000 (+0800) Subject: b=24055 a patch to detect if quota is turned on properly X-Git-Tag: 1.8.5.51~4 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=bbfcbd8b8cfce6142d7c9ef9f2dbb8bae6fd2d07;p=fs%2Flustre-release.git b=24055 a patch to detect if quota is turned on properly i=johann i=panda --- diff --git a/lustre/quota/lproc_quota.c b/lustre/quota/lproc_quota.c index cbef63d..a79062a 100644 --- a/lustre/quota/lproc_quota.c +++ b/lustre/quota/lproc_quota.c @@ -302,6 +302,11 @@ int generic_quota_on(struct obd_device *obd, struct obd_quotactl *oqctl, int glo atomic_inc(&obt->obt_quotachecking); + CDEBUG(D_QUOTA, "%s: quotaon type:master:global:local:flags:rc " + "%u:%d:%d:%d:%lu:%d\n", + obd->obd_name, oqctl->qc_type, is_master, global, local, + obt->obt_qctxt.lqc_flags, rc); + return rc; } diff --git a/lustre/quota/quota_ctl.c b/lustre/quota/quota_ctl.c index d5bef48..84a649d 100644 --- a/lustre/quota/quota_ctl.c +++ b/lustre/quota/quota_ctl.c @@ -228,8 +228,12 @@ int filter_quota_ctl(struct obd_export *exp, struct obd_quotactl *oqctl) if (oqctl->qc_cmd == Q_QUOTAOFF || oqctl->qc_cmd == Q_FINVALIDATE) { - if (!rc && oqctl->qc_cmd == Q_QUOTAOFF) + if (!rc && oqctl->qc_cmd == Q_QUOTAOFF) { obt->obt_qctxt.lqc_flags &= ~UGQUOTA2LQC(oqctl->qc_type); + CDEBUG(D_QUOTA, "%s: quotaoff type:flags:rc " + "%u:%lu:%d\n", obd->obd_name, + oqctl->qc_type, qctxt->lqc_flags, rc); + } atomic_inc(&obt->obt_quotachecking); } break; diff --git a/lustre/quota/quota_master.c b/lustre/quota/quota_master.c index 5cec4e7..effd13b 100644 --- a/lustre/quota/quota_master.c +++ b/lustre/quota/quota_master.c @@ -958,6 +958,8 @@ int mds_quota_off(struct obd_device *obd, struct obd_quotactl *oqctl) if (!rc2) obt->obt_qctxt.lqc_flags &= ~UGQUOTA2LQC(oqctl->qc_type); + CDEBUG(D_QUOTA, "%s: quotaoff type:flags:rc %u:%lu:%d\n", + obd->obd_name, oqctl->qc_type, obt->obt_qctxt.lqc_flags, rc); pop_ctxt(&saved, &obd->obd_lvfs_ctxt, NULL); up(&mds->mds_qonoff_sem); atomic_inc(&obt->obt_quotachecking); diff --git a/lustre/tests/sanity-quota.sh b/lustre/tests/sanity-quota.sh index 6309ad5..03b2e74 100755 --- a/lustre/tests/sanity-quota.sh +++ b/lustre/tests/sanity-quota.sh @@ -292,17 +292,17 @@ quota_show_check() { # set quota test_0() { - $LFS quotaoff -ug $DIR - $LFS quotacheck -ug $DIR - - resetquota -u $TSTUSR - resetquota -g $TSTUSR - lctl set_param debug="+quota" do_facet mds "lctl set_param debug=+quota" for num in `seq $OSTCOUNT`; do - do_facet ost$num "lctl set_param debug=+quota" + do_facet ost$num "lctl set_param debug=+quota" done + + log "do the quotacheck ..." + $LFS quotacheck -ug $DIR + + resetquota -u $TSTUSR + resetquota -g $TSTUSR } run_test_with_stat 0 "Set quota ============================="