From c59cf862c3c06758c270564dd6e8948e167316b9 Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Fri, 29 Mar 2019 09:28:06 -0400 Subject: [PATCH] LU-11678 quota: make overquota flag for old req 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 Reviewed-on: https://review.whamcloud.com/34645 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Shilong Wang Reviewed-by: Gu Zheng Reviewed-by: Oleg Drokin --- lustre/include/uapi/linux/lustre/lustre_idl.h | 3 +++ lustre/osc/osc_quota.c | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lustre/include/uapi/linux/lustre/lustre_idl.h b/lustre/include/uapi/linux/lustre/lustre_idl.h index 08e9531..4b0b67f 100644 --- a/lustre/include/uapi/linux/lustre/lustre_idl.h +++ b/lustre/include/uapi/linux/lustre/lustre_idl.h @@ -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, }; /* diff --git a/lustre/osc/osc_quota.c b/lustre/osc/osc_quota.c index 0a87e9c..a0aaae7 100644 --- a/lustre/osc/osc_quota.c +++ b/lustre/osc/osc_quota.c @@ -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; -- 1.8.3.1