Whamcloud - gitweb
LU-11678 quota: make overquota flag for old req 45/34645/4
authorHongchao Zhang <hongchao@whamcloud.com>
Fri, 29 Mar 2019 13:28:06 +0000 (09:28 -0400)
committerOleg Drokin <green@whamcloud.com>
Tue, 30 Apr 2019 03:35:41 +0000 (03:35 +0000)
For the old request with over quota flag, the over quota flag
should still be marked at OSC, because the old request could be
processed afther the new request at OST, then it won't break the
quota enforement at OST.

Change-Id: Ic34c438fe3f018c3b596b26ad6dc945547c8fada
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34645
Tested-by: Jenkins
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shilong Wang <wshilong@ddn.com>
Reviewed-by: Gu Zheng <gzheng@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/osc/osc_quota.c

index 08e9531..4b0b67f 100644 (file)
@@ -1087,6 +1087,9 @@ enum obdo_flags {
                              OBD_FL_CKSUM_CRC32C | OBD_FL_CKSUM_T10IP512 |
                              OBD_FL_CKSUM_T10IP4K | OBD_FL_CKSUM_T10CRC512 |
                              OBD_FL_CKSUM_T10CRC4K,
+
+       OBD_FL_NO_QUOTA_ALL = OBD_FL_NO_USRQUOTA | OBD_FL_NO_GRPQUOTA |
+                             OBD_FL_NO_PRJQUOTA,
 };
 
 /*
index 0a87e9c..a0aaae7 100644 (file)
@@ -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;