From: Niu Yawei Date: Thu, 28 Jul 2011 10:47:46 +0000 (-0700) Subject: LU-530 group quotas not enforced X-Git-Tag: 2.1.0-RC0~29 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=2d77ef1d80a6a39d50466e67c164f9cf847a0afc LU-530 group quotas not enforced In filter_quota_getflag(), we shouldn't break the loop when the file's owner doesn't have quota limit, otherwise, the check for file's 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: I3e92ba4c061409d5a911d46916535c71f7843e0b Reviewed-on: http://review.whamcloud.com/1156 Tested-by: Hudson Reviewed-by: Fan Yong Tested-by: Maloo Reviewed-by: Johann Lombardi --- diff --git a/lustre/quota/quota_interface.c b/lustre/quota/quota_interface.c index 5b3057c..f2c5f9e 100644 --- a/lustre/quota/quota_interface.c +++ b/lustre/quota/quota_interface.c @@ -202,15 +202,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); - if (rc) - CDEBUG(D_QUOTA, "search lqs for %s %d failed, " - "(rc = %d)\n", - cnt == USRQUOTA ? "user" : "group", - cnt == USRQUOTA ? oa->o_uid : oa->o_gid, - rc); + 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 the file's owner + * doesn't have quota limit. LU-530 */ + continue; } else { cfs_spin_lock(&lqs->lqs_lock); if (lqs->lqs_bunit_sz <= qctxt->lqc_sync_blk) {