1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

o allocate and zero the extents before exporting the lv's

This commit is contained in:
Joe Thornber 2001-10-10 14:56:53 +00:00
parent 398c218b03
commit aed3f57b3b

View File

@ -372,13 +372,7 @@ int export_extents(struct disk_list *dl, int lv_num,
struct physical_volume *pv)
{
struct pe_disk *ped;
int len = sizeof(struct pe_disk) * lv->le_count, le;
if (!(dl->extents = pool_alloc(dl->mem, len))) {
stack;
return 0;
}
memset(&dl->extents, 0, len);
int le;
for (le = 0; le < lv->le_count; le++) {
if (lv->map[le].pv == pv) {
@ -474,7 +468,18 @@ int export_lvs(struct disk_list *dl, struct volume_group *vg,
struct list_head *tmp;
struct lv_list *ll;
struct lvd_list *lvdl;
int lv_num = 1;
int lv_num = 1, len;
/*
* setup the pv's extents array
*/
len = sizeof(struct pe_disk) * dl->pv.pe_total;
if (!(dl->extents = pool_alloc(dl->mem, len))) {
stack;
return 0;
}
memset(&dl->extents, 0, len);
list_for_each(tmp, &dl->lvs) {
ll = list_entry(tmp, struct lv_list, list);