Whamcloud - gitweb
LU-14012 lod: properly initialize lcm in lod_layout_convert() 06/40306/2
authorJohn L. Hammond <jhammond@whamcloud.com>
Tue, 20 Oct 2020 00:40:18 +0000 (17:40 -0700)
committerOleg Drokin <green@whamcloud.com>
Thu, 29 Oct 2020 07:49:51 +0000 (07:49 +0000)
In lod_layout_convert() zero out lcm and lcme before constructing the
converted layout.

Lustre-commit: 6f2a1c911f0a326765e6d11f35bb602daf057948
Lustre-change: https://review.whamcloud.com/40153

Signed-off-by: John L. Hammond <jhammond@whamcloud.com>
Change-Id: I40f96d51cb63816a9bfc34217f02ff7c450de974
Reviewed-on: https://review.whamcloud.com/40306
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lod/lod_object.c

index 8ccf025..ada0d40 100644 (file)
@@ -3225,13 +3225,13 @@ static int lod_layout_convert(struct lod_thread_info *info)
        }
 
        lcm = info->lti_ea_store;
+       memset(lcm, 0, sizeof(*lcm) + sizeof(*lcme));
        lcm->lcm_magic = cpu_to_le32(LOV_MAGIC_COMP_V1);
        lcm->lcm_size = cpu_to_le32(size);
        lcm->lcm_layout_gen = cpu_to_le32(le16_to_cpu(
                                                lmm_save->lmm_layout_gen));
        lcm->lcm_flags = cpu_to_le16(LCM_FL_NONE);
        lcm->lcm_entry_count = cpu_to_le16(1);
-       lcm->lcm_mirror_count = 0;
 
        lcme = &lcm->lcm_entries[0];
        lcme->lcme_flags = cpu_to_le32(LCME_FL_INIT);