Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / obdfilter / filter_io_26.c
index 3bd68f6..a45d9da 100644 (file)
@@ -571,8 +571,8 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa,
         struct filter_obd *fo = &obd->u.filter;
         void *wait_handle;
         int total_size = 0;
-        int rec_pending = 0;
-        unsigned int qcids[MAXQUOTAS] = {0, 0};
+        unsigned int qcids[MAXQUOTAS] = { oa->o_uid, oa->o_gid };
+        int rec_pending[MAXQUOTAS] = { 0, 0 };
         ENTRY;
 
         LASSERT(oti != NULL);
@@ -584,9 +584,9 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa,
 
         /* we try to get enough quota to write here, and let ldiskfs
          * decide if it is out of quota or not b=14783 */
-        lquota_chkquota(filter_quota_interface_ref, obd, oa->o_uid,
-                        oa->o_gid, niocount, &rec_pending, oti,
-                        LQUOTA_FLAGS_BLK, (void *)inode, obj->ioo_bufcnt);
+        lquota_chkquota(filter_quota_interface_ref, obd, qcids, rec_pending,
+                        niocount, oti, LQUOTA_FLAGS_BLK, (void *)inode,
+                        obj->ioo_bufcnt);
 
         iobuf = filter_iobuf_get(&obd->u.filter, oti);
         if (IS_ERR(iobuf))
@@ -731,9 +731,8 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa,
         fsfilt_check_slow(obd, now, "commitrw commit");
 
 cleanup:
-        if (rec_pending)
-                lquota_pending_commit(filter_quota_interface_ref, obd, oa->o_uid,
-                                      oa->o_gid, rec_pending, 1);
+        lquota_pending_commit(filter_quota_interface_ref, obd, qcids,
+                              rec_pending, 1);
 
         filter_grant_commit(exp, niocount, res);