From: Jinshan Xiong Date: Mon, 8 Jan 2018 21:29:51 +0000 (+0000) Subject: LU-10437 lod: clear layout header when generating layout X-Git-Tag: 2.10.4-RC1~122 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=0e38e97e2c4209ac31f3f6f9bc245da9a991006c;p=fs%2Flustre-release.git 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/30784 Tested-by: Jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: Bobi Jam Reviewed-by: John L. Hammond --- diff --git a/lustre/lod/lod_lov.c b/lustre/lod/lod_lov.c index 08d5ce7..1f1133c 100644 --- a/lustre/lod/lod_lov.c +++ b/lustre/lod/lod_lov.c @@ -941,6 +941,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);