mirror of
git://sourceware.org/git/lvm2.git
synced 2025-08-25 13:49:28 +03:00
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.
This commit is contained in:
@ -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;
|
||||
|
@ -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;
|
||||
|
Reference in New Issue
Block a user