Whamcloud - gitweb
LU-10437 lod: clear layout header when generating layout 85/30785/2
authorJinshan Xiong <jinshan.xiong@intel.com>
Mon, 8 Jan 2018 21:36:35 +0000 (21:36 +0000)
committerOleg Drokin <oleg.drokin@intel.com>
Sat, 20 Jan 2018 06:19:49 +0000 (06:19 +0000)
LOD needs to clear layout header otherwise the lcm_flags and
lcm_padding will be random data, which will create issues when
those fields are used by future module.

It already confused FLR because it uses lcm_flags and mirror_count
to do sanity check.

Signed-off-by: Jinshan Xiong <jinshan.xiong@intel.com>
Change-Id: If9511e6691144debd51ccab575ef4479d0c9b865
Reviewed-on: https://review.whamcloud.com/30785
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
lustre/lod/lod_lov.c

index 83296ac..e099a6c 100644 (file)
@@ -962,6 +962,8 @@ int lod_generate_lovea(const struct lu_env *env, struct lod_object *lo,
        }
 
        lcm = (struct lov_comp_md_v1 *)lmm;
+       memset(lcm, 0, sizeof(*lcm));
+
        lcm->lcm_magic = cpu_to_le32(LOV_MAGIC_COMP_V1);
        lcm->lcm_entry_count = cpu_to_le16(comp_cnt);
        lcm->lcm_mirror_count = cpu_to_le16(mirror_cnt - 1);