From: James Simmons Date: Sat, 20 Nov 2021 13:58:53 +0000 (-0500) Subject: LU-11596 osc: Fix and re-enable sanity grant test for ARM X-Git-Tag: 2.14.57~23 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=7d3edce0650f0b66bdd280373a54a16cb28b8469;p=fs%2Flustre-release.git LU-11596 osc: Fix and re-enable sanity grant test for ARM 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 Signed-off-by: Jian Yu Signed-off-by: Xinliang Liu Reviewed-on: https://review.whamcloud.com/40758 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Oleg Drokin --- diff --git a/lustre/osc/osc_cache.c b/lustre/osc/osc_cache.c index fe8a56e..565b8ef 100644 --- a/lustre/osc/osc_cache.c +++ b/lustre/osc/osc_cache.c @@ -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) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 958ab7d..0f0e524 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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