Commit 07aa6595 authored by Hongchao Zhang's avatar Hongchao Zhang Committed by Oleg Drokin
Browse files

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: ce86e23b
Lustre-change: https://review.whamcloud.com/36236



Change-Id: I7f44ce0cb13783ca5bede2f55cd0707f1ccbc8ca
Signed-off-by: default avatarHongchao Zhang <hongchao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/38808

Tested-by: default avatarjenkins <devops@whamcloud.com>
Tested-by: default avatarMaloo <maloo@whamcloud.com>
Reviewed-by: default avatarWang Shilong <wshilong@whamcloud.com>
Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
parent 113c09b1
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment