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

fix segfault handling duplicate PVs

cmd arg was missing when switching to use an alternative
duplicate dev.
This commit is contained in:
David Teigland 2021-10-14 14:02:59 -05:00
parent e88163ceac
commit c38473548e
4 changed files with 5 additions and 5 deletions

View File

@ -1349,7 +1349,7 @@ int lvmcache_label_scan(struct cmd_context *cmd)
dm_list_iterate_items(devl, &add_cache_devs) { dm_list_iterate_items(devl, &add_cache_devs) {
log_debug_cache("Adding chosen duplicate %s", dev_name(devl->dev)); log_debug_cache("Adding chosen duplicate %s", dev_name(devl->dev));
label_scan_dev(devl->dev); label_scan_dev(cmd, devl->dev);
} }
dm_list_splice(&_unused_duplicates, &del_cache_devs); dm_list_splice(&_unused_duplicates, &del_cache_devs);

View File

@ -1488,7 +1488,7 @@ void label_scan_destroy(struct cmd_context *cmd)
* device, this is not a commonly used function. * device, this is not a commonly used function.
*/ */
int label_scan_dev(struct device *dev) int label_scan_dev(struct cmd_context *cmd, struct device *dev)
{ {
struct dm_list one_dev; struct dm_list one_dev;
struct device_list *devl; struct device_list *devl;
@ -1503,7 +1503,7 @@ int label_scan_dev(struct device *dev)
label_scan_invalidate(dev); label_scan_invalidate(dev);
_scan_list(NULL, NULL, &one_dev, 0, &failed); _scan_list(cmd, NULL, &one_dev, 0, &failed);
free(devl); free(devl);

View File

@ -107,7 +107,7 @@ int label_scan_devs(struct cmd_context *cmd, struct dev_filter *f, struct dm_lis
int label_scan_devs_cached(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs); int label_scan_devs_cached(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs);
int label_scan_devs_rw(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs); int label_scan_devs_rw(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs);
int label_scan_devs_excl(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs); int label_scan_devs_excl(struct cmd_context *cmd, struct dev_filter *f, struct dm_list *devs);
int label_scan_dev(struct device *dev); int label_scan_dev(struct cmd_context *cmd, struct device *dev);
void label_scan_invalidate(struct device *dev); void label_scan_invalidate(struct device *dev);
void label_scan_invalidate_lv(struct cmd_context *cmd, struct logical_volume *lv); void label_scan_invalidate_lv(struct cmd_context *cmd, struct logical_volume *lv);
void label_scan_drop(struct cmd_context *cmd); void label_scan_drop(struct cmd_context *cmd);

View File

@ -1481,7 +1481,7 @@ int process_each_label(struct cmd_context *cmd, int argc, char **argv,
/* /*
* add info to lvmcache from the duplicate dev. * add info to lvmcache from the duplicate dev.
*/ */
label_scan_dev(devl->dev); label_scan_dev(cmd, devl->dev);
/* /*
* the info/label should now be found because * the info/label should now be found because