struct physical_volume *pv,
struct volume_group *vg)
{
- char pvid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
+ char pvid[ID_LEN + 1] __attribute__((aligned(8)));
struct format_instance *fid = pv->fid;
struct lvmcache_info *info;
unsigned mda_index;
uint64_t pe_count;
uint64_t size_reduction = 0;
+ pvid[ID_LEN] = 0;
if (*pv->old_id.uuid)
memcpy(pvid, &pv->old_id.uuid, ID_LEN);
else
uint64_t mda_size,
unsigned mda_ignored)
{
- char pvid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
+ char pvid[ID_LEN + 1] __attribute__((aligned(8)));
struct metadata_area *mda;
struct mda_context *mdac;
struct mda_lists *mda_lists = (struct mda_lists *) pv->fmt->private;
memset(&mdac->rlocn, 0, sizeof(mdac->rlocn));
mda_set_ignored(mda, mda_ignored);
+ pvid[ID_LEN] = 0;
memcpy(pvid, &pv->id.uuid, ID_LEN);
fid_add_mda(pv->fid, mda, pvid, ID_LEN, mda_index);
return 1;
}
-
void del_pvl_from_vgs(struct volume_group *vg, struct pv_list *pvl)
{
- char pvid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
+ char pvid[ID_LEN + 1] __attribute__((aligned(8)));
struct lvmcache_info *info;
vg->pv_count--;
dm_list_del(&pvl->list);
+ pvid[ID_LEN] = 0;
memcpy(pvid, &pvl->pv->id.uuid, ID_LEN);
pvl->pv->vg = vg->fid->fmt->orphan_vg; /* orphan */
static void _wipe_outdated_pvs(struct cmd_context *cmd, struct volume_group *vg)
{
- char vgid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
- struct dm_list devs;
+ char vgid[ID_LEN + 1] __attribute__((aligned(8)));
+ DM_LIST_INIT(devs);
struct dm_list *mdas = NULL;
struct device_list *devl;
struct device *dev;
struct lvmcache_info *info;
uint32_t ext_flags;
- dm_list_init(&devs);
-
/*
* When vg_read selected a good copy of the metadata, it used it to
* update the lvmcache representation of the VG (lvmcache_update_vg).
* vginfo->outdated_infos list. Here we clear the PVs on that list.
*/
+ vgid[ID_LEN] = 0;
memcpy(vgid, &vg->id.uuid, ID_LEN);
lvmcache_get_outdated_devs(cmd, vg->name, vgid, &devs);
*/
int vg_write(struct volume_group *vg)
{
- char vgid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
+ char vgid[ID_LEN + 1] __attribute__((aligned(8)));
struct dm_list *mdah;
struct pv_list *pvl, *pvl_safe, *new_pvl;
struct metadata_area *mda;
struct device *mda_dev;
int revert = 0, wrote = 0;
+ vgid[ID_LEN] = 0;
memcpy(vgid, &vg->id.uuid, ID_LEN);
if (vg_is_shared(vg)) {
static int _vg_commit_mdas(struct volume_group *vg)
{
struct metadata_area *mda, *tmda;
- struct dm_list ignored;
+ DM_LIST_INIT(ignored);
int failed = 0;
int good = 0;
int cache_updated = 0;
/* Rearrange the metadata_areas_in_use so ignored mdas come first. */
- dm_list_init(&ignored);
dm_list_iterate_items_safe(mda, tmda, &vg->fid->metadata_areas_in_use)
if (mda_is_ignored(mda))
dm_list_move(&ignored, &mda->list);
static int _check_devs_used_correspond_with_vg(struct volume_group *vg)
{
struct dm_pool *mem;
- char vgid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
+ char vgid[ID_LEN + 1] __attribute__((aligned(8)));
struct pv_list *pvl;
struct lv_list *lvl;
struct dm_list *list;
struct device_list *dl;
int found_inconsistent = 0;
+ vgid[ID_LEN] = 0;
memcpy(vgid, &vg->id.uuid, ID_LEN);
/* Mark all PVs in VG as used. */
struct volume_group *vg,
struct lvmcache_info *info)
{
- char pvid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
+ char pvid[ID_LEN + 1] __attribute__((aligned(8)));
struct physical_volume *pv;
struct device *dev = lvmcache_device(info);
if (!alloc_pv_segment_whole_pv(vg->vgmem, pv))
goto_bad;
+ pvid[ID_LEN] = 0;
memcpy(pvid, &pv->id.uuid, ID_LEN);
lvmcache_fid_add_mdas(info, vg->fid, pvid, ID_LEN);
void vg_write_commit_bad_mdas(struct cmd_context *cmd, struct volume_group *vg)
{
- char vgid[ID_LEN + 1] __attribute__((aligned(8))) = { 0 };
- struct dm_list bad_mda_list;
+ char vgid[ID_LEN + 1] __attribute__((aligned(8)));
+ DM_LIST_INIT(bad_mda_list);
struct mda_list *mdal;
struct metadata_area *mda;
struct device *dev;
- dm_list_init(&bad_mda_list);
-
+ vgid[ID_LEN] = 0;
memcpy(vgid, &vg->id.uuid, ID_LEN);
lvmcache_get_bad_mdas(cmd, vg->name, vgid, &bad_mda_list);
static bool _scan_text_mismatch(struct cmd_context *cmd, const char *vgname, const char *vgid)
{
- struct dm_list mda_list;
+ DM_LIST_INIT(mda_list);
struct mda_list *mdal, *safe;
struct metadata_area *mda;
struct mda_context *mdac;
* else check that all mda_headers are unchanged.
*/
- dm_list_init(&mda_list);
-
lvmcache_get_mdas(cmd, vgname, vgid, &mda_list);
dm_list_iterate_items(mdal, &mda_list) {