Whamcloud - gitweb
LU-11133 dkms: Add missing ldiskfs module in dkms config
[fs/lustre-release.git] / lustre / quota / qsd_handler.c
index a8d842d..eb0bddb 100644 (file)
@@ -21,7 +21,7 @@
  * GPL HEADER END
  */
 /*
- * Copyright (c) 2012, 2014, Intel Corporation.
+ * Copyright (c) 2012, 2017, Intel Corporation.
  * Use is subject to license terms.
  *
  * Author: Johann Lombardi <johann.lombardi@intel.com>
@@ -652,6 +652,13 @@ static bool qsd_acquire(const struct lu_env *env, struct lquota_entry *lqe,
                         * rc < 0, something bad happened */
                         break;
 
+               /* if we have gotten some quota and stil wait more quota,
+                * it's better to give QMT some time to reclaim from clients */
+               if (count > 0) {
+                       set_current_state(TASK_INTERRUPTIBLE);
+                       schedule_timeout(cfs_time_seconds(1));
+               }
+
                /* need to acquire more quota space from master */
                rc = qsd_acquire_remote(env, lqe);
        }