Do not keep multiple archives for the executed command.
Reuse the ALLOCATABLE_PV from pv status for
ARCHIVED_VG vg status. Mark VG with the bit with the
first archivation.
Version 2.02.99 -
===================================
+ Avoid creation of multiple archives for one command.
Use mirror_segtype_default if type not specified for linear->mirror upconvert.
Fix use of too big chunks of memory when communication with lvmetad.
Fix vgcfgrestore crash when specified incorrect vg name.
int archive(struct volume_group *vg)
{
+ if (vg_is_archived(vg))
+ return 1; /* VG has been already archived */
+
if (!vg->cmd->archive_params->enabled || !vg->cmd->archive_params->dir)
return 1;
return 0;
}
+ vg->status |= ARCHIVED_VG;
+
return 1;
}
{SHARED, "SHARED", STATUS_FLAG},
{PARTIAL_VG, NULL, 0},
{PRECOMMITTED, NULL, 0},
+ {ARCHIVED_VG, NULL, 0},
{0, NULL, 0}
};
/* May any free extents on this PV be used or must they be left free? */
#define ALLOCATABLE_PV UINT64_C(0x00000008) /* PV */
+#define ARCHIVED_VG ALLOCATABLE_PV /* VG, reuse same bit */
//#define SPINDOWN_LV UINT64_C(0x00000010) /* LV */
//#define BADBLOCK_ON UINT64_C(0x00000020) /* LV */
#define VGMETADATACOPIES_ALL UINT32_MAX
#define VGMETADATACOPIES_UNMANAGED 0
+#define vg_is_archived(vg) (((vg)->status & ARCHIVED_VG) ? 1 : 0)
+
#define lv_is_external_origin(lv) (((lv)->external_count > 0) ? 1 : 0)
#define lv_is_thin_volume(lv) ((lv)->status & THIN_VOLUME ? 1 : 0)
#define lv_is_thin_pool(lv) ((lv)->status & THIN_POOL ? 1 : 0)