diff options
author | David Teigland <teigland@redhat.com> | 2017-07-28 15:23:34 -0500 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2017-10-16 11:17:12 -0500 |
commit | 0f43f5d401a400fc5686654bc041e43cd3b3ef71 (patch) | |
tree | 89097ad932b379a895194d90a7c90cd2734f881b | |
parent | 6c7ee16a6c2f576ec41ae7c8d1afe11d87420cb5 (diff) | |
download | lvm2-0f43f5d401a400fc5686654bc041e43cd3b3ef71.tar.gz |
labels: avoid label_read when getting device from pvid
When the low levels of vg_read() are parsing VG metadata,
they see a PVID, and try to get the device for it, calling
lvmcache_device_from_pvid(). When this function found
the dev for this PVID in lvmcache, it would issue a
full label_read() on that device and verify that the
pvid/dev mapping in lvmcache is correct.
Remove this label_read() and trust that the pvid to dev
mapping in lvmcache is correct. If metadata changed
between the initial label scan performed by the command,
and the locked vg_read(), then other code exists to
rescan labels.
(The lvmetad case already trusted the contents of lvmcache.)
-rw-r--r-- | lib/cache/lvmcache.c | 49 | ||||
-rw-r--r-- | lib/cache/lvmcache.h | 6 | ||||
-rw-r--r-- | lib/cache/lvmetad.c | 2 | ||||
-rw-r--r-- | lib/format1/format1.c | 3 | ||||
-rw-r--r-- | lib/format_pool/format_pool.c | 3 | ||||
-rw-r--r-- | lib/format_text/archiver.c | 2 | ||||
-rw-r--r-- | lib/format_text/format-text.c | 26 | ||||
-rw-r--r-- | lib/format_text/import-export.h | 2 | ||||
-rw-r--r-- | lib/format_text/import.c | 10 | ||||
-rw-r--r-- | lib/format_text/import_vsn1.c | 54 | ||||
-rw-r--r-- | lib/metadata/metadata.c | 6 | ||||
-rw-r--r-- | lib/metadata/metadata.h | 3 |
12 files changed, 53 insertions, 113 deletions
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c index cc2ebb779..e23b8f0da 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -789,7 +789,7 @@ char *lvmcache_vgname_from_pvid(struct cmd_context *cmd, const char *pvid) struct lvmcache_info *info; char *vgname; - if (!lvmcache_device_from_pvid(cmd, (const struct id *)pvid, NULL, NULL)) { + if (!lvmcache_device_from_pvid(cmd, (const struct id *)pvid, NULL)) { log_error("Couldn't find device with uuid %s.", pvid); return NULL; } @@ -1376,61 +1376,28 @@ struct dm_list *lvmcache_get_pvids(struct cmd_context *cmd, const char *vgname, return pvids; } -static struct device *_device_from_pvid(const struct id *pvid, - uint64_t *label_sector) +static struct device *_device_from_pvid(const struct id *pvid, uint64_t *label_sector) { struct lvmcache_info *info; - struct label *label; if ((info = lvmcache_info_from_pvid((const char *) pvid, NULL, 0))) { - if (lvmetad_used()) { - if (info->label && label_sector) - *label_sector = info->label->sector; - return info->dev; - } - - if (label_read(info->dev, &label, UINT64_C(0))) { - info = (struct lvmcache_info *) label->info; - if (id_equal(pvid, (struct id *) &info->dev->pvid)) { - if (label_sector) - *label_sector = label->sector; - return info->dev; - } - } + if (info->label && label_sector) + *label_sector = info->label->sector; + return info->dev; } + return NULL; } -struct device *lvmcache_device_from_pvid(struct cmd_context *cmd, const struct id *pvid, - unsigned *scan_done_once, uint64_t *label_sector) +struct device *lvmcache_device_from_pvid(struct cmd_context *cmd, const struct id *pvid, uint64_t *label_sector) { struct device *dev; - /* Already cached ? */ - dev = _device_from_pvid(pvid, label_sector); - if (dev) - return dev; - - lvmcache_label_scan(cmd); - - /* Try again */ - dev = _device_from_pvid(pvid, label_sector); - if (dev) - return dev; - - if (critical_section() || (scan_done_once && *scan_done_once)) - return NULL; - - lvmcache_force_next_label_scan(); - lvmcache_label_scan(cmd); - if (scan_done_once) - *scan_done_once = 1; - - /* Try again */ dev = _device_from_pvid(pvid, label_sector); if (dev) return dev; + log_debug_devs("No device with uuid %s.", (const char *)pvid); return NULL; } diff --git a/lib/cache/lvmcache.h b/lib/cache/lvmcache.h index c6b591a11..8ed182462 100644 --- a/lib/cache/lvmcache.h +++ b/lib/cache/lvmcache.h @@ -105,10 +105,8 @@ struct lvmcache_vginfo *lvmcache_vginfo_from_vgid(const char *vgid); struct lvmcache_info *lvmcache_info_from_pvid(const char *pvid, struct device *dev, int valid_only); const char *lvmcache_vgname_from_vgid(struct dm_pool *mem, const char *vgid); const char *lvmcache_vgid_from_vgname(struct cmd_context *cmd, const char *vgname); -struct device *lvmcache_device_from_pvid(struct cmd_context *cmd, const struct id *pvid, - unsigned *scan_done_once, uint64_t *label_sector); -const char *lvmcache_pvid_from_devname(struct cmd_context *cmd, - const char *devname); +struct device *lvmcache_device_from_pvid(struct cmd_context *cmd, const struct id *pvid, uint64_t *label_sector); +const char *lvmcache_pvid_from_devname(struct cmd_context *cmd, const char *devname); char *lvmcache_vgname_from_pvid(struct cmd_context *cmd, const char *pvid); const char *lvmcache_vgname_from_info(struct lvmcache_info *info); const struct format_type *lvmcache_fmt_from_info(struct lvmcache_info *info); diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c index 1ba844fc8..fd8ab1a81 100644 --- a/lib/cache/lvmetad.c +++ b/lib/cache/lvmetad.c @@ -1766,7 +1766,7 @@ static int _lvmetad_pvscan_single(struct metadata_area *mda, void *baton) struct volume_group *vg; if (mda_is_ignored(mda) || - !(vg = mda->ops->vg_read(b->fid, "", mda, NULL, NULL, 1))) + !(vg = mda->ops->vg_read(b->fid, "", mda, NULL, NULL))) return 1; /* FIXME Also ensure contents match etc. */ diff --git a/lib/format1/format1.c b/lib/format1/format1.c index b3569e08e..6e7e888ff 100644 --- a/lib/format1/format1.c +++ b/lib/format1/format1.c @@ -181,8 +181,7 @@ static struct volume_group *_format1_vg_read(struct format_instance *fid, const char *vg_name, struct metadata_area *mda __attribute__((unused)), struct cached_vg_fmtdata **vg_fmtdata __attribute__((unused)), - unsigned *use_previous_vg __attribute__((unused)), - int single_device __attribute__((unused))) + unsigned *use_previous_vg __attribute__((unused))) { struct volume_group *vg; struct disk_list *dl; diff --git a/lib/format_pool/format_pool.c b/lib/format_pool/format_pool.c index f6e5e011b..f8223a392 100644 --- a/lib/format_pool/format_pool.c +++ b/lib/format_pool/format_pool.c @@ -102,8 +102,7 @@ static struct volume_group *_pool_vg_read(struct format_instance *fid, const char *vg_name, struct metadata_area *mda __attribute__((unused)), struct cached_vg_fmtdata **vg_fmtdata __attribute__((unused)), - unsigned *use_previous_vg __attribute__((unused)), - int single_device __attribute__((unused))) + unsigned *use_previous_vg __attribute__((unused))) { struct volume_group *vg; struct user_subpool *usp; diff --git a/lib/format_text/archiver.c b/lib/format_text/archiver.c index d3811556d..c696ee832 100644 --- a/lib/format_text/archiver.c +++ b/lib/format_text/archiver.c @@ -320,7 +320,7 @@ struct volume_group *backup_read_vg(struct cmd_context *cmd, } dm_list_iterate_items(mda, &tf->metadata_areas_in_use) { - if (!(vg = mda->ops->vg_read(tf, vg_name, mda, NULL, NULL, 0))) + if (!(vg = mda->ops->vg_read(tf, vg_name, mda, NULL, NULL))) stack; break; } diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c index e35fa09b2..b05fca934 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c @@ -517,8 +517,7 @@ static struct volume_group *_vg_read_raw_area(struct format_instance *fid, struct device_area *area, struct cached_vg_fmtdata **vg_fmtdata, unsigned *use_previous_vg, - int precommitted, - int single_device) + int precommitted) { struct volume_group *vg = NULL; struct raw_locn *rlocn; @@ -545,12 +544,15 @@ static struct volume_group *_vg_read_raw_area(struct format_instance *fid, } /* FIXME 64-bit */ - if (!(vg = text_vg_import_fd(fid, NULL, vg_fmtdata, use_previous_vg, single_device, area->dev, + if (!(vg = text_vg_import_fd(fid, NULL, vg_fmtdata, use_previous_vg, area->dev, (off_t) (area->start + rlocn->offset), (uint32_t) (rlocn->size - wrap), (off_t) (area->start + MDA_HEADER_SIZE), - wrap, calc_crc, rlocn->checksum, &when, - &desc)) && (!use_previous_vg || !*use_previous_vg)) + wrap, + calc_crc, + rlocn->checksum, + &when, &desc)) + && (!use_previous_vg || !*use_previous_vg)) goto_out; if (vg) @@ -575,8 +577,7 @@ static struct volume_group *_vg_read_raw(struct format_instance *fid, const char *vgname, struct metadata_area *mda, struct cached_vg_fmtdata **vg_fmtdata, - unsigned *use_previous_vg, - int single_device) + unsigned *use_previous_vg) { struct mda_context *mdac = (struct mda_context *) mda->metadata_locn; struct volume_group *vg; @@ -584,7 +585,7 @@ static struct volume_group *_vg_read_raw(struct format_instance *fid, if (!dev_open_readonly(mdac->area.dev)) return_NULL; - vg = _vg_read_raw_area(fid, vgname, &mdac->area, vg_fmtdata, use_previous_vg, 0, single_device); + vg = _vg_read_raw_area(fid, vgname, &mdac->area, vg_fmtdata, use_previous_vg, 0); if (!dev_close(mdac->area.dev)) stack; @@ -604,7 +605,7 @@ static struct volume_group *_vg_read_precommit_raw(struct format_instance *fid, if (!dev_open_readonly(mdac->area.dev)) return_NULL; - vg = _vg_read_raw_area(fid, vgname, &mdac->area, vg_fmtdata, use_previous_vg, 1, 0); + vg = _vg_read_raw_area(fid, vgname, &mdac->area, vg_fmtdata, use_previous_vg, 1); if (!dev_close(mdac->area.dev)) stack; @@ -920,8 +921,7 @@ static struct volume_group *_vg_read_file(struct format_instance *fid, const char *vgname, struct metadata_area *mda, struct cached_vg_fmtdata **vg_fmtdata, - unsigned *use_previous_vg __attribute__((unused)), - int single_device __attribute__((unused))) + unsigned *use_previous_vg __attribute__((unused))) { struct text_context *tc = (struct text_context *) mda->metadata_locn; @@ -1298,7 +1298,7 @@ static int _scan_raw(const struct format_type *fmt, const char *vgname __attribu /* TODO: caching as in read_metadata_location() (trigger this code?) */ if (read_metadata_location(fmt, mdah, NULL, &rl->dev_area, &vgsummary, NULL)) { - vg = _vg_read_raw_area(&fid, vgsummary.vgname, &rl->dev_area, NULL, NULL, 0, 0); + vg = _vg_read_raw_area(&fid, vgsummary.vgname, &rl->dev_area, NULL, NULL, 0); if (vg) lvmcache_update_vg(vg, 0); } @@ -2496,7 +2496,7 @@ static int _get_config_disk_area(struct cmd_context *cmd, return 0; } - if (!(dev_area.dev = lvmcache_device_from_pvid(cmd, &id, NULL, NULL))) { + if (!(dev_area.dev = lvmcache_device_from_pvid(cmd, &id, NULL))) { char buffer[64] __attribute__((aligned(8))); if (!id_write_format(&id, buffer, sizeof(buffer))) diff --git a/lib/format_text/import-export.h b/lib/format_text/import-export.h index de6bcf7a6..5efc3dd49 100644 --- a/lib/format_text/import-export.h +++ b/lib/format_text/import-export.h @@ -49,7 +49,6 @@ struct text_vg_version_ops { int (*check_version) (const struct dm_config_tree * cf); struct volume_group *(*read_vg) (struct format_instance * fid, const struct dm_config_tree *cf, - unsigned use_cached_pvs, unsigned allow_lvmetad_extensions); void (*read_desc) (struct dm_pool * mem, const struct dm_config_tree *cf, time_t *when, char **desc); @@ -75,7 +74,6 @@ struct volume_group *text_vg_import_fd(struct format_instance *fid, const char *file, struct cached_vg_fmtdata **vg_fmtdata, unsigned *use_previous_vg, - int single_device, struct device *dev, off_t offset, uint32_t size, off_t offset2, uint32_t size2, diff --git a/lib/format_text/import.c b/lib/format_text/import.c index a977763a7..5569961da 100644 --- a/lib/format_text/import.c +++ b/lib/format_text/import.c @@ -127,7 +127,6 @@ struct volume_group *text_vg_import_fd(struct format_instance *fid, const char *file, struct cached_vg_fmtdata **vg_fmtdata, unsigned *use_previous_vg, - int single_device, struct device *dev, off_t offset, uint32_t size, off_t offset2, uint32_t size2, @@ -178,7 +177,7 @@ struct volume_group *text_vg_import_fd(struct format_instance *fid, if (!(*vsn)->check_version(cft)) continue; - if (!(vg = (*vsn)->read_vg(fid, cft, single_device, 0))) + if (!(vg = (*vsn)->read_vg(fid, cft, 0))) goto_out; (*vsn)->read_desc(vg->vgmem, cft, when, desc); @@ -202,7 +201,10 @@ struct volume_group *text_vg_import_file(struct format_instance *fid, const char *file, time_t *when, char **desc) { - return text_vg_import_fd(fid, file, NULL, NULL, 0, NULL, (off_t)0, 0, (off_t)0, 0, NULL, 0, + return text_vg_import_fd(fid, file, NULL, NULL, NULL, + (off_t)0, 0, (off_t)0, 0, + NULL, + 0, when, desc); } @@ -223,7 +225,7 @@ static struct volume_group *_import_vg_from_config_tree(const struct dm_config_t * The only path to this point uses cached vgmetadata, * so it can use cached PV state too. */ - if (!(vg = (*vsn)->read_vg(fid, cft, 1, allow_lvmetad_extensions))) + if (!(vg = (*vsn)->read_vg(fid, cft, allow_lvmetad_extensions))) stack; else if ((vg_missing = vg_missing_pv_count(vg))) { log_verbose("There are %d physical volumes missing.", diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c index 9267d4581..b41d83c8f 100644 --- a/lib/format_text/import_vsn1.c +++ b/lib/format_text/import_vsn1.c @@ -32,9 +32,7 @@ typedef int (*section_fn) (struct format_instance * fid, struct volume_group * vg, const struct dm_config_node * pvn, const struct dm_config_node * vgn, struct dm_hash_table * pv_hash, - struct dm_hash_table * lv_hash, - unsigned *scan_done_once, - unsigned report_missing_devices); + struct dm_hash_table * lv_hash); #define _read_int32(root, path, result) \ dm_config_get_uint32(root, path, (uint32_t *) (result)) @@ -180,9 +178,7 @@ static int _read_pv(struct format_instance *fid, struct volume_group *vg, const struct dm_config_node *pvn, const struct dm_config_node *vgn __attribute__((unused)), struct dm_hash_table *pv_hash, - struct dm_hash_table *lv_hash __attribute__((unused)), - unsigned *scan_done_once, - unsigned report_missing_devices) + struct dm_hash_table *lv_hash __attribute__((unused))) { struct dm_pool *mem = vg->vgmem; struct physical_volume *pv; @@ -220,16 +216,12 @@ static int _read_pv(struct format_instance *fid, /* * Convert the uuid into a device. */ - if (!(pv->dev = lvmcache_device_from_pvid(fid->fmt->cmd, &pv->id, scan_done_once, - &pv->label_sector))) { + if (!(pv->dev = lvmcache_device_from_pvid(fid->fmt->cmd, &pv->id, &pv->label_sector))) { char buffer[64] __attribute__((aligned(8))); if (!id_write_format(&pv->id, buffer, sizeof(buffer))) buffer[0] = '\0'; - if (report_missing_devices) - log_error_once("Couldn't find device with uuid %s.", buffer); - else - log_very_verbose("Couldn't find device with uuid %s.", buffer); + log_error_once("Couldn't find device with uuid %s.", buffer); } if (!(pv->vg_name = dm_pool_strdup(mem, vg->name))) @@ -574,9 +566,7 @@ static int _read_lvnames(struct format_instance *fid __attribute__((unused)), struct volume_group *vg, const struct dm_config_node *lvn, const struct dm_config_node *vgn __attribute__((unused)), struct dm_hash_table *pv_hash __attribute__((unused)), - struct dm_hash_table *lv_hash, - unsigned *scan_done_once __attribute__((unused)), - unsigned report_missing_devices __attribute__((unused))) + struct dm_hash_table *lv_hash) { struct dm_pool *mem = vg->vgmem; struct logical_volume *lv; @@ -731,9 +721,7 @@ static int _read_historical_lvnames(struct format_instance *fid __attribute__((u struct volume_group *vg, const struct dm_config_node *hlvn, const struct dm_config_node *vgn __attribute__((unused)), struct dm_hash_table *pv_hash __attribute__((unused)), - struct dm_hash_table *lv_hash __attribute__((unused)), - unsigned *scan_done_once __attribute__((unused)), - unsigned report_missing_devices __attribute__((unused))) + struct dm_hash_table *lv_hash __attribute__((unused))) { struct dm_pool *mem = vg->vgmem; struct generic_logical_volume *glv; @@ -802,9 +790,7 @@ static int _read_historical_lvnames_interconnections(struct format_instance *fid struct volume_group *vg, const struct dm_config_node *hlvn, const struct dm_config_node *vgn __attribute__((unused)), struct dm_hash_table *pv_hash __attribute__((unused)), - struct dm_hash_table *lv_hash __attribute__((unused)), - unsigned *scan_done_once __attribute__((unused)), - unsigned report_missing_devices __attribute__((unused))) + struct dm_hash_table *lv_hash __attribute__((unused))) { struct dm_pool *mem = vg->vgmem; const char *historical_lv_name, *origin_name = NULL; @@ -914,9 +900,7 @@ static int _read_lvsegs(struct format_instance *fid, struct volume_group *vg, const struct dm_config_node *lvn, const struct dm_config_node *vgn __attribute__((unused)), struct dm_hash_table *pv_hash, - struct dm_hash_table *lv_hash, - unsigned *scan_done_once __attribute__((unused)), - unsigned report_missing_devices __attribute__((unused))) + struct dm_hash_table *lv_hash) { struct logical_volume *lv; @@ -977,12 +961,9 @@ static int _read_sections(struct format_instance *fid, struct volume_group *vg, const struct dm_config_node *vgn, struct dm_hash_table *pv_hash, struct dm_hash_table *lv_hash, - int optional, - unsigned *scan_done_once) + int optional) { const struct dm_config_node *n; - /* Only report missing devices when doing a scan */ - unsigned report_missing_devices = scan_done_once ? !*scan_done_once : 1; if (!dm_config_get_section(vgn, section, &n)) { if (!optional) { @@ -994,8 +975,7 @@ static int _read_sections(struct format_instance *fid, } for (n = n->child; n; n = n->sib) { - if (!fn(fid, vg, n, vgn, pv_hash, lv_hash, - scan_done_once, report_missing_devices)) + if (!fn(fid, vg, n, vgn, pv_hash, lv_hash)) return_0; } @@ -1004,7 +984,6 @@ static int _read_sections(struct format_instance *fid, static struct volume_group *_read_vg(struct format_instance *fid, const struct dm_config_tree *cft, - unsigned use_cached_pvs, unsigned allow_lvmetad_extensions) { const struct dm_config_node *vgn; @@ -1012,7 +991,6 @@ static struct volume_group *_read_vg(struct format_instance *fid, const char *str, *format_str, *system_id; struct volume_group *vg; struct dm_hash_table *pv_hash = NULL, *lv_hash = NULL; - unsigned scan_done_once = use_cached_pvs; uint64_t vgstatus; /* skip any top-level values */ @@ -1167,7 +1145,7 @@ static struct volume_group *_read_vg(struct format_instance *fid, } if (!_read_sections(fid, "physical_volumes", _read_pv, vg, - vgn, pv_hash, lv_hash, 0, &scan_done_once)) { + vgn, pv_hash, lv_hash, 0)) { log_error("Couldn't find all physical volumes for volume " "group %s.", vg->name); goto bad; @@ -1175,7 +1153,7 @@ static struct volume_group *_read_vg(struct format_instance *fid, if (allow_lvmetad_extensions) _read_sections(fid, "outdated_pvs", _read_pv, vg, - vgn, pv_hash, lv_hash, 1, &scan_done_once); + vgn, pv_hash, lv_hash, 1); else if (dm_config_has_node(vgn, "outdated_pvs")) log_error(INTERNAL_ERROR "Unexpected outdated_pvs section in metadata of VG %s.", vg->name); @@ -1187,28 +1165,28 @@ static struct volume_group *_read_vg(struct format_instance *fid, } if (!_read_sections(fid, "logical_volumes", _read_lvnames, vg, - vgn, pv_hash, lv_hash, 1, NULL)) { + vgn, pv_hash, lv_hash, 1)) { log_error("Couldn't read all logical volume names for volume " "group %s.", vg->name); goto bad; } if (!_read_sections(fid, "historical_logical_volumes", _read_historical_lvnames, vg, - vgn, pv_hash, lv_hash, 1, NULL)) { + vgn, pv_hash, lv_hash, 1)) { log_error("Couldn't read all historical logical volumes for volume " "group %s.", vg->name); goto bad; } if (!_read_sections(fid, "logical_volumes", _read_lvsegs, vg, - vgn, pv_hash, lv_hash, 1, NULL)) { + vgn, pv_hash, lv_hash, 1)) { log_error("Couldn't read all logical volumes for " "volume group %s.", vg->name); goto bad; } if (!_read_sections(fid, "historical_logical_volumes", _read_historical_lvnames_interconnections, - vg, vgn, pv_hash, lv_hash, 1, NULL)) { + vg, vgn, pv_hash, lv_hash, 1)) { log_error("Couldn't read all removed logical volume interconnections " "for volume group %s.", vg->name); goto bad; diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c index 4deda443d..6718e93ac 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -1837,7 +1837,7 @@ struct physical_volume *pvcreate_vol(struct cmd_context *cmd, const char *pv_nam } if (pp->pva.idp) { - if ((dev = lvmcache_device_from_pvid(cmd, pp->pva.idp, NULL, NULL)) && + if ((dev = lvmcache_device_from_pvid(cmd, pp->pva.idp, NULL)) && (dev != dev_cache_get(pv_name, cmd->full_filter))) { if (!id_write_format((const struct id*)&pp->pva.idp->uuid, buffer, sizeof(buffer))) @@ -4359,7 +4359,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd, if ((use_precommitted && !(vg = mda->ops->vg_read_precommit(fid, vgname, mda, &vg_fmtdata, &use_previous_vg)) && !use_previous_vg) || (!use_precommitted && - !(vg = mda->ops->vg_read(fid, vgname, mda, &vg_fmtdata, &use_previous_vg, 0)) && !use_previous_vg)) { + !(vg = mda->ops->vg_read(fid, vgname, mda, &vg_fmtdata, &use_previous_vg)) && !use_previous_vg)) { inconsistent = 1; vg_fmtdata = NULL; continue; @@ -4551,7 +4551,7 @@ static struct volume_group *_vg_read(struct cmd_context *cmd, if ((use_precommitted && !(vg = mda->ops->vg_read_precommit(fid, vgname, mda, &vg_fmtdata, &use_previous_vg)) && !use_previous_vg) || (!use_precommitted && - !(vg = mda->ops->vg_read(fid, vgname, mda, &vg_fmtdata, &use_previous_vg, 0)) && !use_previous_vg)) { + !(vg = mda->ops->vg_read(fid, vgname, mda, &vg_fmtdata, &use_previous_vg)) && !use_previous_vg)) { inconsistent = 1; vg_fmtdata = NULL; continue; diff --git a/lib/metadata/metadata.h b/lib/metadata/metadata.h index f3b1c95d8..31c914c88 100644 --- a/lib/metadata/metadata.h +++ b/lib/metadata/metadata.h @@ -80,8 +80,7 @@ struct metadata_area_ops { const char *vg_name, struct metadata_area * mda, struct cached_vg_fmtdata **vg_fmtdata, - unsigned *use_previous_vg, - int single_device); + unsigned *use_previous_vg); struct volume_group *(*vg_read_precommit) (struct format_instance * fi, const char *vg_name, struct metadata_area * mda, |