/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2011 Whamcloud, Inc.
+ *
*/
/*
* This file is part of Lustre, http://www.lustre.org/
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) {
else
pending[i] += mb;
}
+ LASSERTF(pending[i] >= 0, "pending is not valid"
+ ", count=%d, mb=%d\n", count, mb);
lqs->lqs_bwrite_pending += pending[i];
} else {
pending[i] = count;