Whamcloud - gitweb
LU-14075 kernel: kernel update RHEL8.2 [4.18.0-193.28.1.el8_2]
[fs/lustre-release.git] / lustre / osc / osc_quota.c
index 0a87e9c..4320ae4 100644 (file)
@@ -61,11 +61,11 @@ int osc_quota_chkdq(struct client_obd *cli, const unsigned int qid[])
                         * quota space on this OST */
                        CDEBUG(D_QUOTA, "chkdq found noquota for %s %d\n",
                               type == USRQUOTA ? "user" : "grout", qid[type]);
-                       RETURN(NO_QUOTA);
+                       RETURN(-EDQUOT);
                }
        }
 
-       RETURN(QUOTA_OK);
+       RETURN(0);
 }
 
 static inline u32 md_quota_flag(int qtype)
@@ -108,10 +108,16 @@ int osc_quota_setdq(struct client_obd *cli, __u64 xid, const unsigned int qid[],
                RETURN(0);
 
        mutex_lock(&cli->cl_quota_mutex);
-       if (cli->cl_quota_last_xid > xid)
+       /* still mark the quots is running out for the old request, because it
+        * could be processed after the new request at OST, the side effect is
+        * the following request will be processed synchronously, but it will
+        * not break the quota enforcement. */
+       if (cli->cl_quota_last_xid > xid && !(flags & OBD_FL_NO_QUOTA_ALL))
                GOTO(out_unlock, rc);
 
-       cli->cl_quota_last_xid = xid;
+       if (cli->cl_quota_last_xid < xid)
+               cli->cl_quota_last_xid = xid;
+
        for (type = 0; type < LL_MAXQUOTAS; type++) {
                struct osc_quota_info *oqi;