From d8b19ae6617733df003a906aca1791791a5f0eff Mon Sep 17 00:00:00 2001 From: Lai Siyao Date: Mon, 1 Jul 2019 23:02:07 +0800 Subject: [PATCH] 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 --- lustre/mdc/mdc_request.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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) -- 1.8.3.1