Whamcloud - gitweb
LU-11596 osc: Fix and re-enable sanity grant test for ARM 58/40758/19
authorJames Simmons <jsimmons@infradead.org>
Sat, 20 Nov 2021 13:58:53 +0000 (08:58 -0500)
committerOleg Drokin <green@whamcloud.com>
Tue, 18 Jan 2022 09:08:09 +0000 (09:08 +0000)
If both OST and OSC support OBD_CONNECT_GRANT_PARAM, OST side will not
change client side claimed grant (a.k.a. o_grant_used) regardless of
the client page size. So no grant loss in this case.

Fixes: bd1e41672c97 ("LU-2049 grant: add support for OBD_CONNECT_GRANT_PARAM")
Change-Id: Ia0d3da587cb551400fec0c054dc65b116e6bd95b
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Jian Yu <yujian@whamcloud.com>
Signed-off-by: Xinliang Liu <xinliang.liu@linaro.org>
Reviewed-on: https://review.whamcloud.com/40758
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osc/osc_cache.c
lustre/tests/sanity.sh

index fe8a56e..565b8ef 100644 (file)
@@ -862,11 +862,14 @@ int osc_extent_finish(const struct lu_env *env, struct osc_extent *ext,
 
        if (!sent) {
                lost_grant = ext->oe_grants;
-       } else if (blocksize < PAGE_SIZE &&
+       } else if (cli->cl_ocd_grant_param == 0 &&
+                  blocksize < PAGE_SIZE &&
                   last_count != PAGE_SIZE) {
-               /* For short writes we shouldn't count parts of pages that
-                * span a whole chunk on the OST side, or our accounting goes
-                * wrong.  Should match the code in filter_grant_check. */
+               /* For short writes without OBD_CONNECT_GRANT support, we
+                * shouldn't count parts of pages that span a whole chunk on
+                * the OST side, or our accounting goes wrong. Should match
+                * the code in tgt_grant_check.
+                */
                int offset = last_off & ~PAGE_MASK;
                int count = last_count + (offset & (blocksize - 1));
                int end = (offset + last_count) & (blocksize - 1);
@@ -1451,11 +1454,11 @@ static void osc_unreserve_grant(struct client_obd *cli,
  * used, we should return these grants to OST. There're two cases where grants
  * can be lost:
  * 1. truncate;
- * 2. blocksize at OST is less than PAGE_SIZE and a partial page was
- *    written. In this case OST may use less chunks to serve this partial
- *    write. OSTs don't actually know the page size on the client side. so
- *    clients have to calculate lost grant by the blocksize on the OST.
- *    See filter_grant_check() for details.
+ * 2. Without OBD_CONNECT_GRANT support and blocksize at OST is less than
+ *    PAGE_SIZE and a partial page was written. In this case OST may use less
+ *    chunks to serve this partial write. OSTs don't actually know the page
+ *    size on the client side. so clients have to calculate lost grant by the
+ *    blocksize on the OST. See tgt_grant_check() for details.
  */
 static void osc_free_grant(struct client_obd *cli, unsigned int nr_pages,
                           unsigned int lost_grant, unsigned int dirty_grant)
index 958ab7d..0f0e524 100755 (executable)
@@ -57,8 +57,6 @@ fi
 
 # skip the grant tests for ARM until they are fixed
 if [[ $(uname -m) = aarch64 ]]; then
-       # bug number:    LU-11596
-       ALWAYS_EXCEPT+=" $GRANT_CHECK_LIST"
        # bug number:    LU-11671
        ALWAYS_EXCEPT+=" 45"
        # bug number:    LU-14067 LU-14067