Whamcloud - gitweb
LU-10094 mdc: dir page ldp_hash_end mistakenly adjusted 12/35812/2
authorLai Siyao <lai.siyao@whamcloud.com>
Sun, 18 Aug 2019 06:09:19 +0000 (23:09 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 4 Sep 2019 18:33:44 +0000 (18:33 +0000)
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")

This patch is back-ported from the following one:
Lustre-commit: d8b19ae6617733df003a906aca1791791a5f0eff
Lustre-change: https://review.whamcloud.com/35517

Test-Parameters: clientarch=ppc64 envdefinitions=ONLY="18 22 32 48" \
testlist=sanity

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: I89bb8b93f1fe5f7962f0b80d122ef9965cf15c63
Reviewed-on: https://review.whamcloud.com/35812
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Patrick Farrell <pfarrell@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/mdc/mdc_request.c

index 825f2c4..9f84503 100644 (file)
@@ -1222,12 +1222,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);
@@ -1242,8 +1242,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)