Whamcloud - gitweb
Branch b1_8
authortianzy <tianzy>
Mon, 28 Jul 2008 04:53:53 +0000 (04:53 +0000)
committertianzy <tianzy>
Mon, 28 Jul 2008 04:53:53 +0000 (04:53 +0000)
Have O_DIRECT honor the quota
b=16125
i=johann
i=tom.wang

lustre/obdfilter/filter_io_26.c

index a8e6547..abb2344 100644 (file)
@@ -697,10 +697,11 @@ int filter_commitrw_write(struct obd_export *exp, struct obdo *oa,
                 if (this_size > iattr.ia_size)
                         iattr.ia_size = this_size;
 
-                /* if one page is a write-back page from client cache, or it's
-                 * written by root, then mark the whole io request as ignore
-                 * quota request */
-                if (lnb->flags & (OBD_BRW_FROM_GRANT | OBD_BRW_NOQUOTA))
+                /* if one page is a write-back page from client cache and
+                 * not from direct_io, or it's written by root, then mark
+                 * the whole io request as ignore quota request */
+                if (lnb->flags & OBD_BRW_NOQUOTA ||
+                    (lnb->flags & (OBD_BRW_FROM_GRANT | OBD_BRW_SYNC)) == OBD_BRW_FROM_GRANT)
                         iobuf->dr_ignore_quota = 1;
         }