summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Rajnoha <prajnoha@redhat.com>2016-02-02 13:54:19 +0100
committerPeter Rajnoha <prajnoha@redhat.com>2016-02-02 13:57:19 +0100
commit1498bc8cc442ebafea95e5dd8af69cdcd43619c2 (patch)
tree1092a69abe55bde1b7a75ac7a9c050139082107d
parentec43f55445966b5075fa8083921d182a0a138326 (diff)
downloadlvm2-1498bc8cc442ebafea95e5dd8af69cdcd43619c2.tar.gz
metadata: format: also delete bootloader areas from lvmcache when reading lvm1 and pool label
lvm1 and pool format do not support bootloader areas and we need to remove any existing associated bootloader areas when we read lvm1 and pool labels. This has its importance if we're converting from one format to another and we're reusing lvmcache in long-running commands (e.g. clvmd or lvm shell) and we need to make lvmcache consistent and valid for current format.
-rw-r--r--lib/format1/lvm1-label.c1
-rw-r--r--lib/format_pool/disk_rep.c1
2 files changed, 2 insertions, 0 deletions
diff --git a/lib/format1/lvm1-label.c b/lib/format1/lvm1-label.c
index 6f8ee542b..b600bd712 100644
--- a/lib/format1/lvm1-label.c
+++ b/lib/format1/lvm1-label.c
@@ -81,6 +81,7 @@ static int _lvm1_read(struct labeller *l, struct device *dev, void *buf,
lvmcache_set_device_size(info, ((uint64_t)xlate32(pvd->pv_size)) << SECTOR_SHIFT);
lvmcache_del_mdas(info);
+ lvmcache_del_bas(info);
lvmcache_make_valid(info);
return 1;
diff --git a/lib/format_pool/disk_rep.c b/lib/format_pool/disk_rep.c
index 75d5299fb..688c52190 100644
--- a/lib/format_pool/disk_rep.c
+++ b/lib/format_pool/disk_rep.c
@@ -105,6 +105,7 @@ int read_pool_label(struct pool_list *pl, struct labeller *l,
lvmcache_set_device_size(info, ((uint64_t)xlate32_be(pd->pl_blocks)) << SECTOR_SHIFT);
lvmcache_del_mdas(info);
+ lvmcache_del_bas(info);
lvmcache_make_valid(info);
pl->dev = dev;