summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--WHATS_NEW1
-rw-r--r--tools/toollib.c15
2 files changed, 15 insertions, 1 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index 8523b5eb7..7c979d69c 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
version 2.03.20 -
====================================
+ Fix segfault if using -S|--select with log/report_command_log=1 setting.
Configure now fails when requested lvmlockd dependencies are missing.
Add some configure Gentoo enhancements for static builds.
diff --git a/tools/toollib.c b/tools/toollib.c
index 194088ea6..43e628abf 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -2050,7 +2050,20 @@ void destroy_processing_handle(struct cmd_context *cmd, struct processing_handle
log_restore_report_state(cmd->cmd_report.saved_log_report_state);
- if (!cmd->is_interactive) {
+ /*
+ * Do not destroy current cmd->report_group and cmd->log_rh
+ * (the log report) yet if we're running interactively
+ * (== running in lvm shell) or if there's a parent handle
+ * (== we're executing nested processing, like it is when
+ * doing selection for parent's process_each_* processing).
+ *
+ * In both cases, there's still possible further processing
+ * to do outside the processing covered by the handle we are
+ * destroying here and for which we may still need to access
+ * the log report to cover the rest of the processing.
+ *
+ */
+ if (!cmd->is_interactive && !handle->parent) {
if (!dm_report_group_destroy(cmd->cmd_report.report_group))
stack;
cmd->cmd_report.report_group = NULL;