From c55bdd6eea17ea470908a3ae8981a42e7231de05 Mon Sep 17 00:00:00 2001 From: Niu Yawei Date: Sun, 24 Jul 2011 22:20:36 -0700 Subject: [PATCH] LU-530 group quotas not enforced In filter_quota_getflag(), we shouldn't break the loop when the file owner's quota limit isn't set, otherwise, the check for the file group will be skipped and the out of quota flag will not be returned to client at the end. Signed-off-by: Niu Yawei Change-Id: Ibf6f1fe3a550ce1f4b3d627fe24ca4484e754a41 Reviewed-on: http://review.whamcloud.com/1153 Reviewed-by: Fan Yong Tested-by: Hudson Reviewed-by: Johann Lombardi --- lustre/quota/quota_interface.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lustre/quota/quota_interface.c b/lustre/quota/quota_interface.c index dc6f6da..59244a5 100644 --- a/lustre/quota/quota_interface.c +++ b/lustre/quota/quota_interface.c @@ -195,9 +195,17 @@ static int filter_quota_getflag(struct obd_device *obd, struct obdo *oa) lqs = quota_search_lqs(LQS_KEY(cnt, GET_OA_ID(cnt, oa)), qctxt, 0); - if (lqs == NULL || IS_ERR(lqs)) { + if (IS_ERR(lqs)) { rc = PTR_ERR(lqs); + CDEBUG(D_QUOTA, "search lqs for %s %d failed," + "(rc = %d)\n", + cnt == USRQUOTA ? "user" : "group", + GET_OA_ID(cnt, oa), rc); break; + } else if (lqs == NULL) { + /* continue to check group quota if quota limit + * of the file's user owner isn't set. LU-530 */ + continue; } else { spin_lock(&lqs->lqs_lock); if (lqs->lqs_bunit_sz <= qctxt->lqc_sync_blk) { -- 1.8.3.1