From: Lai Siyao Date: Mon, 1 Jul 2019 15:02:07 +0000 (+0800) Subject: LU-10094 mdc: dir page ldp_hash_end mistakenly adjusted X-Git-Tag: 2.12.57~1 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=d8b19ae6617733df003a906aca1791791a5f0eff;p=fs%2Flustre-release.git LU-10094 mdc: dir page ldp_hash_end mistakenly adjusted On system PAGE_SIZE > 4k, mdc_adjust_dirpages() adjusts dir page end hash with le64_to_cpu() value, but it should be little endian. Fixes: 9d087dfd0fd ("LU-4516 mdc: missing lexxx_to_cpu in mdc_read_entry") Test-Parameters: clientarch=ppc64 envdefinitions=ONLY="18 22 32 48" \ testlist=sanity Signed-off-by: Lai Siyao Change-Id: I89bb8b93f1fe5f7962f0b80d122ef9965cf15c63 Reviewed-on: https://review.whamcloud.com/35517 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin --- diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index d6d978d..04cef2a 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1252,12 +1252,12 @@ static void mdc_adjust_dirpages(struct page **pages, int cfs_pgs, int lu_pgs) int i; for (i = 0; i < cfs_pgs; i++) { - struct lu_dirpage *dp = kmap(pages[i]); - struct lu_dirpage *first = dp; - struct lu_dirent *end_dirent = NULL; - struct lu_dirent *ent; - __u64 hash_end = le64_to_cpu(dp->ldp_hash_end); - __u32 flags = le32_to_cpu(dp->ldp_flags); + struct lu_dirpage *dp = kmap(pages[i]); + struct lu_dirpage *first = dp; + struct lu_dirent *end_dirent = NULL; + struct lu_dirent *ent; + __u64 hash_end = dp->ldp_hash_end; + __u32 flags = dp->ldp_flags; while (--lu_pgs > 0) { ent = lu_dirent_start(dp); @@ -1272,8 +1272,8 @@ static void mdc_adjust_dirpages(struct page **pages, int cfs_pgs, int lu_pgs) break; /* Save the hash and flags of this lu_dirpage. */ - hash_end = le64_to_cpu(dp->ldp_hash_end); - flags = le32_to_cpu(dp->ldp_flags); + hash_end = dp->ldp_hash_end; + flags = dp->ldp_flags; /* Check if lu_dirpage contains no entries. */ if (end_dirent == NULL)