Whamcloud - gitweb
LU-11678 quota: make overquota flag for old req 16/34916/4
authorHongchao Zhang <hongchao@whamcloud.com>
Fri, 29 Mar 2019 13:28:06 +0000 (09:28 -0400)
committerOleg Drokin <green@whamcloud.com>
Sun, 11 Aug 2019 23:33:21 +0000 (23:33 +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.

Lustre-change: https://review.whamcloud.com/34645
Lustre-commit: c59cf862c3c06758c270564dd6e8948e167316b9

Test-Parameters: testlist=replay-single,replay-single,replay-single
Test-Parameters: testlist=replay-single,replay-single,replay-single
Change-Id: Ic34c438fe3f018c3b596b26ad6dc945547c8fada
Signed-off-by: Hongchao Zhang <hongchao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Shilong Wang <wshilong@ddn.com>
Reviewed-by: Gu Zheng <gzheng@ddn.com>
Signed-off-by: Minh Diep <mdiep@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/34916
Reviewed-by: Wang Shilong <wshilong@ddn.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/uapi/linux/lustre/lustre_idl.h
lustre/osc/osc_quota.c

index a95a359..d9b4428 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;