Whamcloud - gitweb
LU-12166 test: fix broken detection on ZFS
[fs/lustre-release.git] / lustre / quota / qsd_reint.c
index b355eb8..fb90ca1 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, 2016, Intel Corporation.
+ * Copyright (c) 2012, 2017, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann.lombardi@intel.com>
@@ -89,6 +89,14 @@ static int qsd_reint_qid(const struct lu_env *env, struct qsd_qtype_info *qqi,
 
        rc = qsd_update_index(env, qqi, qid, global, 0, rec);
 out:
+
+       if (global && qid->qid_uid == 0) {
+               struct lquota_glb_rec *glb_rec = (struct lquota_glb_rec *)rec;
+               qsd_update_default_quota(qqi, glb_rec->qbr_hardlimit,
+                                        glb_rec->qbr_softlimit,
+                                        glb_rec->qbr_time);
+       }
+
        lqe_putref(lqe);
        RETURN(rc);
 }
@@ -631,6 +639,10 @@ int qsd_start_reint_thread(struct qsd_qtype_info *qqi)
        char                    *name;
        ENTRY;
 
+       /* do not try to start a new thread as this can lead to a deadlock */
+       if (current->flags & (PF_MEMALLOC | PF_KSWAPD))
+               RETURN(0);
+
        if (qsd->qsd_dev->dd_rdonly)
                RETURN(0);
 
@@ -638,7 +650,7 @@ int qsd_start_reint_thread(struct qsd_qtype_info *qqi)
        if (!qsd_type_enabled(qsd, qqi->qqi_qtype))
                RETURN(0);
 
-       if (qsd->qsd_acct_failed)
+       if (qqi->qqi_acct_failed)
                /* no space accounting support, can't enable enforcement */
                RETURN(0);