From 07aa6595d18515ae3fa215b79020fe26263098cf Mon Sep 17 00:00:00 2001 From: Hongchao Zhang Date: Tue, 2 Jun 2020 09:20:47 -0700 Subject: [PATCH] LU-12758 quota: clear default flag for new ID When setting the quota limits as 0 by "lfs setquota", the default flag won't be cleared if the lquota_entry is just created for some quota ID at the first time because the quota limits are the same. This patch is back-ported from the following one: Lustre-commit: ce86e23b21ccffc395089578c0ca356de219ac88 Lustre-change: https://review.whamcloud.com/36236 Change-Id: I7f44ce0cb13783ca5bede2f55cd0707f1ccbc8ca Signed-off-by: Hongchao Zhang Reviewed-on: https://review.whamcloud.com/38808 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Wang Shilong Reviewed-by: Oleg Drokin --- lustre/quota/qmt_handler.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/lustre/quota/qmt_handler.c b/lustre/quota/qmt_handler.c index 455652c..ab48ae7 100644 --- a/lustre/quota/qmt_handler.c +++ b/lustre/quota/qmt_handler.c @@ -192,15 +192,16 @@ quota_set: dirtied = true; } - if (dirtied) { - if (!is_default && lqe->lqe_is_default) { - LQUOTA_DEBUG(lqe, "the qid %llu has been set quota" - " explicitly, clear the default flag", - lqe->lqe_id.qid_uid); + if (!is_default && lqe->lqe_is_default) { + LQUOTA_DEBUG(lqe, "the qid %llu has been set quota" + " explicitly, clear the default flag", + lqe->lqe_id.qid_uid); - qmt_lqe_clear_default(lqe); - } + qmt_lqe_clear_default(lqe); + dirtied = true; + } + if (dirtied) { if (!is_updated) { /* write new quota settings to disk */ rc = qmt_glb_write(env, th, lqe, LQUOTA_BUMP_VER, &ver); -- 1.8.3.1