File kdump-Do-not-list-all-block-devices-if-no-block-devices-ar.patch of Package kdump.21346
From: Petr Tesarik <ptesarik@suse.com>
Date: Mon, 1 Mar 2021 17:56:22 +0100
Subject: Do not list all block devices if no block devices are necessary
References: bsc#1180513
Upstream: merged
Git-commit: 0ce491e551ab8398c2e46fa5406306892cc33062
If no block devices are needed to save the dump, lsblk is executed
without any positional arguments, but then it lists all devices on
the system.
Skip the lsblk invocation instead.
Signed-off-by: Petr Tesarik <ptesarik@suse.com>
---
kdumptool/mounts.cc | 3 +++
1 file changed, 3 insertions(+)
--- a/kdumptool/mounts.cc
+++ b/kdumptool/mounts.cc
@@ -370,6 +370,9 @@ StringStringMap& FilesystemTypeMap::devi
{
Debug::debug()->trace("FilesystemTypeMap::devices()");
+ if (m_sources.empty())
+ return m_devices;
+
ProcessFilter p;
StringVector args;