Whamcloud - gitweb
LU-530 group quotas not enforced
authorNiu Yawei <niu@whamcloud.com>
Mon, 25 Jul 2011 05:20:36 +0000 (22:20 -0700)
committerJohann Lombardi <johann@whamcloud.com>
Fri, 29 Jul 2011 12:02:32 +0000 (08:02 -0400)
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 <niu@whamcloud.com>
Change-Id: Ibf6f1fe3a550ce1f4b3d627fe24ca4484e754a41
Reviewed-on: http://review.whamcloud.com/1153
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Tested-by: Hudson
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/quota/quota_interface.c

index dc6f6da..59244a5 100644 (file)
@@ -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) {