From 47d6ce20cfd8b04f20f7fc7accc39b3902780900 Mon Sep 17 00:00:00 2001 From: Jinshan Xiong Date: Mon, 8 Jan 2018 21:36:35 +0000 Subject: [PATCH] LU-10437 lod: clear layout header when generating layout 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 Change-Id: If9511e6691144debd51ccab575ef4479d0c9b865 Reviewed-on: https://review.whamcloud.com/30785 Tested-by: Jenkins Reviewed-by: Andreas Dilger Reviewed-by: Bobi Jam Tested-by: Maloo --- lustre/lod/lod_lov.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lustre/lod/lod_lov.c b/lustre/lod/lod_lov.c index 83296ac..e099a6c 100644 --- a/lustre/lod/lod_lov.c +++ b/lustre/lod/lod_lov.c @@ -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); -- 1.8.3.1