From: Hongchao Zhang Date: Tue, 17 Sep 2019 12:57:50 +0000 (-0400) Subject: LU-12758 quota: clear default flag for new ID X-Git-Tag: 2.12.90~90 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F36236%2F2;hp=d908fe9686bc1e583da7434856d9c06e6cbbc4fd;p=fs%2Flustre-release.git 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. Change-Id: I7f44ce0cb13783ca5bede2f55cd0707f1ccbc8ca Signed-off-by: Hongchao Zhang Reviewed-on: https://review.whamcloud.com/36236 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Shilong Wang Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/quota/qmt_handler.c b/lustre/quota/qmt_handler.c index 511b7f9..9d2a4cc 100644 --- a/lustre/quota/qmt_handler.c +++ b/lustre/quota/qmt_handler.c @@ -191,15 +191,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);