Whamcloud - gitweb
LU-3050 quota: amend sync write checking from 1.8 client
[fs/lustre-release.git] / lustre / osd-zfs / osd_io.c
index 1597701..b081857 100644 (file)
@@ -558,10 +558,15 @@ static int osd_declare_write_commit(const struct lu_env *env,
                /* ignore quota for the whole request if any page is from
                 * client cache or written by root.
                 *
+                * XXX once we drop the 1.8 client support, the checking
+                * for whether page is from cache can be simplified as:
+                * !(lnb[i].flags & OBD_BRW_SYNC)
+                *
                 * XXX we could handle this on per-lnb basis as done by
                 * grant. */
                if ((lnb[i].flags & OBD_BRW_NOQUOTA) ||
-                   !(lnb[i].flags & OBD_BRW_SYNC))
+                   (lnb[i].flags & (OBD_BRW_FROM_GRANT | OBD_BRW_SYNC)) ==
+                   OBD_BRW_FROM_GRANT)
                        ignore_quota = true;
                if (size == 0) {
                        /* first valid lnb */