Whamcloud - gitweb
LU-11775 obdclass: protect imp_sec using rwlock_t
[fs/lustre-release.git] / lustre / quota / qsd_writeback.c
index 51a985c..3c4f0fd 100644 (file)
@@ -298,6 +298,11 @@ static int qsd_process_upd(const struct lu_env *env, struct qsd_upd_rec *upd)
                        GOTO(out, rc);
                /* refresh usage */
                qsd_refresh_usage(env, lqe);
+
+               spin_lock(&qqi->qqi_qsd->qsd_adjust_lock);
+               lqe->lqe_adjust_time = 0;
+               spin_unlock(&qqi->qqi_qsd->qsd_adjust_lock);
+
                /* Report usage asynchronously */
                rc = qsd_adjust(env, lqe);
                if (rc)
@@ -307,6 +312,21 @@ static int qsd_process_upd(const struct lu_env *env, struct qsd_upd_rec *upd)
        rc = qsd_update_index(env, qqi, &upd->qur_qid, upd->qur_global,
                              upd->qur_ver, &upd->qur_rec);
 out:
+       if (upd->qur_global && rc == 0 &&
+           upd->qur_rec.lqr_glb_rec.qbr_softlimit == 0 &&
+           upd->qur_rec.lqr_glb_rec.qbr_hardlimit == 0 &&
+           (LQUOTA_FLAG(upd->qur_rec.lqr_glb_rec.qbr_time) &
+                                                       LQUOTA_FLAG_DEFAULT)) {
+               lqe->lqe_is_default = true;
+               if (qqi->qqi_default_softlimit == 0 &&
+                   qqi->qqi_default_hardlimit == 0)
+                       lqe->lqe_enforced = false;
+               else
+                       lqe->lqe_enforced = true;
+
+               LQUOTA_DEBUG(lqe, "update to use default quota");
+       }
+
        if (lqe && !IS_ERR(lqe)) {
                lqe_putref(lqe);
                upd->qur_lqe = NULL;