Whamcloud - gitweb
LU-9802 pfl: swapping lcm_entry_count correctly 56/28256/4
authorJinshan Xiong <jinshan.xiong@intel.com>
Thu, 27 Jul 2017 16:49:42 +0000 (09:49 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 21 Sep 2017 06:13:41 +0000 (06:13 +0000)
It's a u16 integer so it should use le16_to_cpu() instead of
le32_to_cpu().

Test-Parameters: trivial
Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: I43c31a76d78aa294a3e3296a1bb69f4d6fb1423d
Reviewed-on: https://review.whamcloud.com/28256
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/lod/lod_lov.c
lustre/mdt/mdt_open.c

index 89be42f..3fb0f2e 100644 (file)
@@ -1654,12 +1654,12 @@ int lod_verify_striping(struct lod_device *d, const struct lu_buf *buf,
                        RETURN(-EINVAL);
                }
 
-               if (le32_to_cpu(comp_v1->lcm_entry_count) == 0) {
+               if (le16_to_cpu(comp_v1->lcm_entry_count) == 0) {
                        CDEBUG(D_LAYOUT, "entry count is zero\n");
                        RETURN(-EINVAL);
                }
 
-               for (i = 0; i < le32_to_cpu(comp_v1->lcm_entry_count); i++) {
+               for (i = 0; i < le16_to_cpu(comp_v1->lcm_entry_count); i++) {
                        ent = &comp_v1->lcm_entries[i];
                        ext = &ent->lcme_extent;
 
index 1fc0938..e04c202 100644 (file)
@@ -1670,7 +1670,7 @@ static inline int mdt_hsm_set_released(struct lov_mds_md *lmm)
                if (comp_v1->lcm_entry_count == 0)
                        return -EINVAL;
 
-               for (i = 0; i < le32_to_cpu(comp_v1->lcm_entry_count); i++) {
+               for (i = 0; i < le16_to_cpu(comp_v1->lcm_entry_count); i++) {
                        off = le32_to_cpu(comp_v1->lcm_entries[i].lcme_offset);
                        v1 = (struct lov_mds_md *)((char *)comp_v1 + off);
                        v1->lmm_pattern |= cpu_to_le32(LOV_PATTERN_F_RELEASED);