From: Wang Shilong Date: Fri, 9 Mar 2018 07:38:51 +0000 (+0800) Subject: LU-10795 quota: fix wrong skipping of reintegration X-Git-Tag: 2.10.4-RC1~18 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=c7d1b0b51db29870f5bafb150c79afa913aa398a;p=fs%2Flustre-release.git LU-10795 quota: fix wrong skipping of reintegration There are two problems addressed by this patch: 1)In qsd_prepare(), if @qqi_acct_failed is true, that only means one type of quota failed, Quota should continue to handle. 2)In qsd_config(), only trigger reintegration if this type of quota is newly enabled, this could fix annoying messages when admin running $ lctl conf_param lustre.quota.mdt=ug LustreError: 0-0: lustre-MDT0000: can't enable quota enforcement since space accounting isn't functional. Please run tunefs.lustre --quota on an unmounted filesystem if not done already Lustre-change: https://review.whamcloud.com/31607 Lustre-commit: 7a216e31b74ef0b825adf36eed5f636da8b07533 Change-Id: I9bad618e7e8fa836902cac9f446714cd6c03f98a Signed-off-by: Wang Shilong Reviewed-by: Andreas Dilger Reviewed-by: Fan Yong Reviewed-by: Hongchao Zhang Signed-off-by: Minh Diep Reviewed-on: https://review.whamcloud.com/32013 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond --- diff --git a/lustre/quota/qsd_config.c b/lustre/quota/qsd_config.c index 91e1386..b5b9cd9 100644 --- a/lustre/quota/qsd_config.c +++ b/lustre/quota/qsd_config.c @@ -131,7 +131,7 @@ int qsd_process_config(struct lustre_cfg *lcfg) char *fsname = lustre_cfg_string(lcfg, 0); char *cfgstr = lustre_cfg_string(lcfg, 1); char *keystr, *valstr; - int rc, pool, enabled = 0; + int rc, pool, enabled = 0, old_enabled = 0; bool reint = false; ENTRY; @@ -170,6 +170,7 @@ int qsd_process_config(struct lustre_cfg *lcfg) if ((qfs->qfs_enabled[pool - LQUOTA_FIRST_RES] & enabled) != enabled) reint = true; + old_enabled = qfs->qfs_enabled[pool - LQUOTA_FIRST_RES]; qfs->qfs_enabled[pool - LQUOTA_FIRST_RES] = enabled; /* trigger reintegration for all qsd */ @@ -192,6 +193,12 @@ int qsd_process_config(struct lustre_cfg *lcfg) for (type = USRQUOTA; type < LL_MAXQUOTAS; type++) { qqi = qsd->qsd_type_array[type]; + /* only trigger reintegration if this + * type of quota is not enabled before */ + if ((old_enabled & 1 << type) || + !(enabled & 1 << type)) + continue; + if (qqi->qqi_acct_failed) { LCONSOLE_ERROR("%s: can't enable quota " "enforcement since space " diff --git a/lustre/quota/qsd_lib.c b/lustre/quota/qsd_lib.c index f4c37e6..ffaa77a 100644 --- a/lustre/quota/qsd_lib.c +++ b/lustre/quota/qsd_lib.c @@ -759,7 +759,7 @@ int qsd_prepare(const struct lu_env *env, struct qsd_instance *qsd) ". Please run tunefs.lustre --quota on " "an unmounted filesystem if not done " "already\n", qsd->qsd_svname); - break; + continue; } rc = qsd_start_reint_thread(qqi);