diff --git a/WHATS_NEW b/WHATS_NEW index cd2d8edb8..fe42b81af 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.99 - =================================== + Report backtrace from dump filter error path. Do not use persistent filter with lvmetad. Composable persistent filter functionality for global filter. Override system's global_filter settings for vgimportclone. diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c index 81b8de145..6f935dbc4 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -708,8 +708,9 @@ int lvmcache_label_scan(struct cmd_context *cmd, int full_scan) * device cache for the benefit of short-lived processes. */ if (full_scan == 2 && cmd->is_long_lived && - cmd->dump_filter && cmd->filter && cmd->filter->dump) - cmd->filter->dump(cmd->filter, 0); + cmd->dump_filter && cmd->filter && cmd->filter->dump && + !cmd->filter->dump(cmd->filter, 0)) + stack; r = 1; diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c index 00887ab27..c409f2ac4 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -1652,8 +1652,9 @@ void destroy_toolcontext(struct cmd_context *cmd) struct dm_config_tree *cft_cmdline; FILE *new_stream; - if (cmd->dump_filter && cmd->filter && cmd->filter->dump) - cmd->filter->dump(cmd->filter, 1); + if (cmd->dump_filter && cmd->filter && cmd->filter->dump && + !cmd->filter->dump(cmd->filter, 1)) + stack; archive_exit(cmd); backup_exit(cmd); diff --git a/lib/device/dev-cache.h b/lib/device/dev-cache.h index b886098a5..0d342c5cc 100644 --- a/lib/device/dev-cache.h +++ b/lib/device/dev-cache.h @@ -26,7 +26,7 @@ struct dev_filter { int (*passes_filter) (struct dev_filter * f, struct device * dev); void (*destroy) (struct dev_filter * f); void (*wipe) (struct dev_filter * f); - void (*dump) (struct dev_filter * f, int merge_existing); + int (*dump) (struct dev_filter * f, int merge_existing); void *private; unsigned use_count; }; diff --git a/lib/filters/filter-composite.c b/lib/filters/filter-composite.c index bc37213f4..1229460f2 100644 --- a/lib/filters/filter-composite.c +++ b/lib/filters/filter-composite.c @@ -1,6 +1,6 @@ /* * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. - * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. + * Copyright (C) 2004-2013 Red Hat, Inc. All rights reserved. * * This file is part of LVM2. * @@ -49,15 +49,16 @@ static void _composite_destroy(struct dev_filter *f) dm_free(f); } -static void _dump(struct dev_filter *f, int merge_existing) +static int _dump(struct dev_filter *f, int merge_existing) { - struct dev_filter **filters = (struct dev_filter **) f->private; + struct dev_filter **filters; - while (*filters) { - if ((*filters)->dump) - (*filters)->dump(*filters, merge_existing); - filters++; - } + for (filters = (struct dev_filter **) f->private; *filters; ++filters) + if ((*filters)->dump && + !(*filters)->dump(*filters, merge_existing)) + return_0; + + return 1; } static void _wipe(struct dev_filter *f)