Whamcloud - gitweb
LU-10795 quota: fix wrong skipping of reintegration 07/31607/2
authorWang Shilong <wshilong@ddn.com>
Fri, 9 Mar 2018 07:38:51 +0000 (15:38 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 9 Apr 2018 19:46:38 +0000 (19:46 +0000)
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

Change-Id: I9bad618e7e8fa836902cac9f446714cd6c03f98a
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/31607
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Fan Yong <fan.yong@intel.com>
Reviewed-by: Hongchao Zhang <hongchao.zhang@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/quota/qsd_config.c
lustre/quota/qsd_lib.c

index 3eb49c9..5077861 100644 (file)
@@ -122,7 +122,7 @@ out:
 int qsd_config(char *valstr, char *fsname, int pool)
 {
        struct qsd_fsinfo *qfs;
-       int rc, enabled = 0;
+       int rc, enabled = 0, old_enabled = 0;
        bool reint = false;
 
        ENTRY;
@@ -148,6 +148,7 @@ int qsd_config(char *valstr, char *fsname, int pool)
        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 */
@@ -170,6 +171,12 @@ int qsd_config(char *valstr, char *fsname, int pool)
 
                        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 "
index c906cea..5eb5a72 100644 (file)
@@ -802,7 +802,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);