1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-03-11 20:58:50 +03:00

Fix LVM1 backwards compatibility issue when LV with a low LV number is deleted.

This commit is contained in:
Alasdair Kergon 2002-05-23 11:37:51 +00:00
parent 2a670fac46
commit 5f05971a84

View File

@ -500,7 +500,7 @@ static int _write_lvd(struct device *dev, ulong pos, struct lv_disk *disk)
static int _write_lvs(struct disk_list *data) static int _write_lvs(struct disk_list *data)
{ {
struct list *lvh; struct list *lvh;
ulong pos; ulong pos, offset;
pos = data->pvd.lv_on_disk.base; pos = data->pvd.lv_on_disk.base;
@ -513,10 +513,15 @@ static int _write_lvs(struct disk_list *data)
list_iterate(lvh, &data->lvds) { list_iterate(lvh, &data->lvds) {
struct lvd_list *ll = list_item(lvh, struct lvd_list); struct lvd_list *ll = list_item(lvh, struct lvd_list);
if (!_write_lvd(data->dev, pos, &ll->lvd)) offset = sizeof(struct lv_disk) * ll->lvd.lv_number;
fail; if (offset + sizeof(struct lv_disk) >
data->pvd.lv_on_disk.size) {
log_error("lv_number %d too large", ll->lvd.lv_number);
return 0;
}
pos += sizeof(struct lv_disk); if (!_write_lvd(data->dev, pos + offset, &ll->lvd))
fail;
} }
return 1; return 1;