Compare commits
No commits in common. "c8" and "imports/c8-beta/libblockdev-2.19-12.el8" have entirely different histories.
c8
...
imports/c8
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
||||
SOURCES/libblockdev-2.28.tar.gz
|
||||
SOURCES/libblockdev-2.19.tar.gz
|
||||
|
||||
@ -1 +1 @@
|
||||
d32fce132c75d94ad9c033a636906d63027ffba5 SOURCES/libblockdev-2.28.tar.gz
|
||||
849d4ab5a9b78b568c8928337691a1052bd6ab57 SOURCES/libblockdev-2.19.tar.gz
|
||||
|
||||
@ -1,59 +0,0 @@
|
||||
From 7a0e344d0642f76992c943158621d8ee7e5caea3 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Tue, 15 Nov 2022 13:21:25 +0100
|
||||
Subject: [PATCH 1/2] crypto: Fix GError overwrite from libvolume_key
|
||||
|
||||
---
|
||||
src/plugins/crypto.c | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
|
||||
index 35c38410..9064c8e3 100644
|
||||
--- a/src/plugins/crypto.c
|
||||
+++ b/src/plugins/crypto.c
|
||||
@@ -2552,13 +2552,14 @@ static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libv
|
||||
GIOChannel *out_file = NULL;
|
||||
GIOStatus status = G_IO_STATUS_ERROR;
|
||||
gsize bytes_written = 0;
|
||||
+ GError *l_error = NULL;
|
||||
|
||||
packet_data = libvk_volume_create_packet_asymmetric_with_format (volume, &packet_data_size, secret_type, cert,
|
||||
- ui, LIBVK_PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY, error);
|
||||
-
|
||||
+ ui, LIBVK_PACKET_FORMAT_ASYMMETRIC_WRAP_SECRET_ONLY, &l_error);
|
||||
if (!packet_data) {
|
||||
g_set_error (error, BD_CRYPTO_ERROR, BD_CRYPTO_ERROR_ESCROW_FAILED,
|
||||
- "Failed to get escrow data");
|
||||
+ "Failed to get escrow data: %s", l_error->message);
|
||||
+ g_clear_error (&l_error);
|
||||
libvk_volume_free (volume);
|
||||
return FALSE;
|
||||
}
|
||||
--
|
||||
2.38.1
|
||||
|
||||
|
||||
From 25bf34c4c03e37eb3782dfccf459b9a3f795ddb3 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Wed, 16 Nov 2022 10:26:06 +0100
|
||||
Subject: [PATCH 2/2] crypto: Fix double free in write_escrow_data_file
|
||||
|
||||
---
|
||||
src/plugins/crypto.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
diff --git a/src/plugins/crypto.c b/src/plugins/crypto.c
|
||||
index 9064c8e3..2086209e 100644
|
||||
--- a/src/plugins/crypto.c
|
||||
+++ b/src/plugins/crypto.c
|
||||
@@ -2560,7 +2560,6 @@ static gboolean write_escrow_data_file (struct libvk_volume *volume, struct libv
|
||||
g_set_error (error, BD_CRYPTO_ERROR, BD_CRYPTO_ERROR_ESCROW_FAILED,
|
||||
"Failed to get escrow data: %s", l_error->message);
|
||||
g_clear_error (&l_error);
|
||||
- libvk_volume_free (volume);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
--
|
||||
2.38.1
|
||||
|
||||
407
SOURCES/0001-swap-error-codes.patch
Normal file
407
SOURCES/0001-swap-error-codes.patch
Normal file
@ -0,0 +1,407 @@
|
||||
From 3f9f1fa90a087186dcc96060537543d2685616d8 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Mon, 1 Oct 2018 16:06:42 +0200
|
||||
Subject: [PATCH 1/2] Use libblkid to check swap status before swapon
|
||||
|
||||
libblkid probe is more reliable than our custom check.
|
||||
---
|
||||
configure.ac | 2 +-
|
||||
src/plugins/Makefile.am | 4 +-
|
||||
src/plugins/swap.c | 149 ++++++++++++++++++++++++++++++++--------
|
||||
3 files changed, 124 insertions(+), 31 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 6285a48..7ac5089 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -227,7 +227,7 @@ AS_IF([test "x$with_fs" != "xno"],
|
||||
AC_SUBST([PARTED_FS_CFLAGS], [])])],
|
||||
[])
|
||||
|
||||
-AS_IF([test "x$with_fs" != "xno" -o "x$with_crypto" != "xno"],
|
||||
+AS_IF([test "x$with_fs" != "xno" -o "x$with_crypto" != "xno" -o "x$with_swap" != "xno"],
|
||||
[LIBBLOCKDEV_PKG_CHECK_MODULES([BLKID], [blkid >= 2.23.0])
|
||||
# older versions of libblkid don't support BLKID_SUBLKS_BADCSUM so let's just
|
||||
# define it as 0 (neutral value for bit combinations of flags)
|
||||
diff --git a/src/plugins/Makefile.am b/src/plugins/Makefile.am
|
||||
index e7b4bf0..6219a40 100644
|
||||
--- a/src/plugins/Makefile.am
|
||||
+++ b/src/plugins/Makefile.am
|
||||
@@ -149,8 +149,8 @@ libbd_nvdimm_la_SOURCES = nvdimm.c nvdimm.h check_deps.c check_deps.h
|
||||
endif
|
||||
|
||||
if WITH_SWAP
|
||||
-libbd_swap_la_CFLAGS = $(GLIB_CFLAGS) -Wall -Wextra -Werror
|
||||
-libbd_swap_la_LIBADD = $(GLIB_LIBS) ${builddir}/../utils/libbd_utils.la
|
||||
+libbd_swap_la_CFLAGS = $(GLIB_CFLAGS) $(BLKID_CFLAGS) -Wall -Wextra -Werror
|
||||
+libbd_swap_la_LIBADD = $(GLIB_LIBS) $(BLKID_LIBS) ${builddir}/../utils/libbd_utils.la
|
||||
libbd_swap_la_LDFLAGS = -L${srcdir}/../utils/ -version-info 2:0:0 -Wl,--no-undefined
|
||||
libbd_swap_la_CPPFLAGS = -I${builddir}/../../include/
|
||||
libbd_swap_la_SOURCES = swap.c swap.h check_deps.c check_deps.h
|
||||
diff --git a/src/plugins/swap.c b/src/plugins/swap.c
|
||||
index bc52637..bfe653f 100644
|
||||
--- a/src/plugins/swap.c
|
||||
+++ b/src/plugins/swap.c
|
||||
@@ -21,6 +21,8 @@
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/swap.h>
|
||||
+#include <fcntl.h>
|
||||
+#include <blkid.h>
|
||||
#include <blockdev/utils.h>
|
||||
|
||||
#include "swap.h"
|
||||
@@ -179,13 +181,14 @@ gboolean bd_swap_mkswap (const gchar *device, const gchar *label, const BDExtraA
|
||||
* Tech category: %BD_SWAP_TECH_SWAP-%BD_SWAP_TECH_MODE_ACTIVATE_DEACTIVATE
|
||||
*/
|
||||
gboolean bd_swap_swapon (const gchar *device, gint priority, GError **error) {
|
||||
- GIOChannel *dev_file = NULL;
|
||||
- GIOStatus io_status = G_IO_STATUS_ERROR;
|
||||
- GError *tmp_error = NULL;
|
||||
- gsize num_read = 0;
|
||||
- gchar dev_status[11];
|
||||
- dev_status[10] = '\0';
|
||||
- gint page_size;
|
||||
+ blkid_probe probe = NULL;
|
||||
+ gint fd = 0;
|
||||
+ gint status = 0;
|
||||
+ guint n_try = 0;
|
||||
+ const gchar *value = NULL;
|
||||
+ gint64 status_len = 0;
|
||||
+ gint64 swap_pagesize = 0;
|
||||
+ gint64 sys_pagesize = 0;
|
||||
gint flags = 0;
|
||||
gint ret = 0;
|
||||
guint64 progress_id = 0;
|
||||
@@ -198,53 +201,143 @@ gboolean bd_swap_swapon (const gchar *device, gint priority, GError **error) {
|
||||
|
||||
bd_utils_report_progress (progress_id, 0, "Analysing the swap device");
|
||||
/* check the device if it is an activatable swap */
|
||||
- dev_file = g_io_channel_new_file (device, "r", error);
|
||||
- if (!dev_file) {
|
||||
- /* error is already populated */
|
||||
+ probe = blkid_new_probe ();
|
||||
+ if (!probe) {
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
+ "Failed to create a new probe");
|
||||
bd_utils_report_finished (progress_id, (*error)->message);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
- page_size = getpagesize ();
|
||||
- page_size = MAX (2048, page_size);
|
||||
- io_status = g_io_channel_seek_position (dev_file, page_size - 10, G_SEEK_SET, &tmp_error);
|
||||
- if (io_status != G_IO_STATUS_NORMAL) {
|
||||
+ fd = open (device, O_RDONLY|O_CLOEXEC);
|
||||
+ if (fd == -1) {
|
||||
g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
- "Failed to determine device's state: %s", tmp_error->message);
|
||||
- g_clear_error (&tmp_error);
|
||||
- g_io_channel_shutdown (dev_file, FALSE, &tmp_error);
|
||||
+ "Failed to open the device '%s'", device);
|
||||
bd_utils_report_finished (progress_id, (*error)->message);
|
||||
+ blkid_free_probe (probe);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
- io_status = g_io_channel_read_chars (dev_file, dev_status, 10, &num_read, &tmp_error);
|
||||
- if ((io_status != G_IO_STATUS_NORMAL) || (num_read != 10)) {
|
||||
+ /* we may need to try mutliple times with some delays in case the device is
|
||||
+ busy at the very moment */
|
||||
+ for (n_try=5, status=-1; (status != 0) && (n_try > 0); n_try--) {
|
||||
+ status = blkid_probe_set_device (probe, fd, 0, 0);
|
||||
+ if (status != 0)
|
||||
+ g_usleep (100 * 1000); /* microseconds */
|
||||
+ }
|
||||
+ if (status != 0) {
|
||||
g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
- "Failed to determine device's state: %s", tmp_error->message);
|
||||
- g_clear_error (&tmp_error);
|
||||
- g_io_channel_shutdown (dev_file, FALSE, &tmp_error);
|
||||
- g_clear_error (&tmp_error);
|
||||
+ "Failed to create a probe for the device '%s'", device);
|
||||
bd_utils_report_finished (progress_id, (*error)->message);
|
||||
+ blkid_free_probe (probe);
|
||||
+ close (fd);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
- g_io_channel_shutdown (dev_file, FALSE, &tmp_error);
|
||||
- g_clear_error (&tmp_error);
|
||||
+ blkid_probe_enable_superblocks (probe, 1);
|
||||
+ blkid_probe_set_superblocks_flags (probe, BLKID_SUBLKS_TYPE | BLKID_SUBLKS_MAGIC);
|
||||
|
||||
- if (g_str_has_prefix (dev_status, "SWAP-SPACE")) {
|
||||
+ /* we may need to try mutliple times with some delays in case the device is
|
||||
+ busy at the very moment */
|
||||
+ for (n_try=5, status=-1; !(status == 0 || status == 1) && (n_try > 0); n_try--) {
|
||||
+ status = blkid_do_safeprobe (probe);
|
||||
+ if (status < 0)
|
||||
+ g_usleep (100 * 1000); /* microseconds */
|
||||
+ }
|
||||
+ if (status < 0) {
|
||||
+ /* -1 or -2 = error during probing*/
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
+ "Failed to probe the device '%s'", device);
|
||||
+ bd_utils_report_finished (progress_id, (*error)->message);
|
||||
+ blkid_free_probe (probe);
|
||||
+ close (fd);
|
||||
+ return FALSE;
|
||||
+ } else if (status == 1) {
|
||||
+ /* 1 = nothing detected */
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
+ "No superblock detected on the device '%s'", device);
|
||||
+ bd_utils_report_finished (progress_id, (*error)->message);
|
||||
+ blkid_free_probe (probe);
|
||||
+ close (fd);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ status = blkid_probe_lookup_value (probe, "TYPE", &value, NULL);
|
||||
+ if (status != 0) {
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
+ "Failed to get format type for the device '%s'", device);
|
||||
+ bd_utils_report_finished (progress_id, (*error)->message);
|
||||
+ blkid_free_probe (probe);
|
||||
+ close (fd);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (g_strcmp0 (value, "swap") != 0) {
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
+ "Device '%s' is not formatted as swap", device);
|
||||
+ bd_utils_report_finished (progress_id, (*error)->message);
|
||||
+ blkid_free_probe (probe);
|
||||
+ close (fd);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ status = blkid_probe_lookup_value (probe, "SBMAGIC", &value, NULL);
|
||||
+ if (status != 0) {
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
+ "Failed to get swap status on the device '%s'", device);
|
||||
+ bd_utils_report_finished (progress_id, (*error)->message);
|
||||
+ blkid_free_probe (probe);
|
||||
+ close (fd);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ if (g_strcmp0 (value, "SWAP-SPACE") == 0) {
|
||||
g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_ACTIVATE,
|
||||
"Old swap format, cannot activate.");
|
||||
bd_utils_report_finished (progress_id, (*error)->message);
|
||||
+ blkid_free_probe (probe);
|
||||
+ close (fd);
|
||||
return FALSE;
|
||||
- } else if (g_str_has_prefix (dev_status, "S1SUSPEND") || g_str_has_prefix (dev_status, "S2SUSPEND")) {
|
||||
+ } else if (g_strcmp0 (value, "S1SUSPEND") == 0 || g_strcmp0 (value, "S2SUSPEND") == 0) {
|
||||
g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_ACTIVATE,
|
||||
"Suspended system on the swap device, cannot activate.");
|
||||
bd_utils_report_finished (progress_id, (*error)->message);
|
||||
+ blkid_free_probe (probe);
|
||||
+ close (fd);
|
||||
return FALSE;
|
||||
- } else if (!g_str_has_prefix (dev_status, "SWAPSPACE2")) {
|
||||
+ } else if (g_strcmp0 (value, "SWAPSPACE2") != 0) {
|
||||
g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_ACTIVATE,
|
||||
"Unknown swap space format, cannot activate.");
|
||||
bd_utils_report_finished (progress_id, (*error)->message);
|
||||
+ blkid_free_probe (probe);
|
||||
+ close (fd);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ status_len = (gint64) strlen (value);
|
||||
+
|
||||
+ status = blkid_probe_lookup_value (probe, "SBMAGIC_OFFSET", &value, NULL);
|
||||
+ if (status != 0 || !value) {
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
+ "Failed to get swap status on the device '%s'", device);
|
||||
+ bd_utils_report_finished (progress_id, (*error)->message);
|
||||
+ blkid_free_probe (probe);
|
||||
+ close (fd);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
+ swap_pagesize = status_len + g_ascii_strtoll (value, (char **)NULL, 10);
|
||||
+
|
||||
+ blkid_free_probe (probe);
|
||||
+ close (fd);
|
||||
+
|
||||
+ sys_pagesize = getpagesize ();
|
||||
+
|
||||
+ if (swap_pagesize != sys_pagesize) {
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
+ "Swap format pagesize (%"G_GINT64_FORMAT") and system pagesize (%"G_GINT64_FORMAT") don't match",
|
||||
+ swap_pagesize, sys_pagesize);
|
||||
+ bd_utils_report_finished (progress_id, (*error)->message);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
||||
From f6508829e7cac138e4961a1c3ef6170d6f67bfd9 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Thu, 4 Oct 2018 08:07:55 +0200
|
||||
Subject: [PATCH 2/2] Add error codes and Python exceptions for swapon fails
|
||||
|
||||
We need to be able to tell why swapon failed so our users can
|
||||
decide what to do.
|
||||
---
|
||||
src/lib/plugin_apis/swap.api | 4 ++++
|
||||
src/plugins/swap.c | 10 +++++-----
|
||||
src/plugins/swap.h | 4 ++++
|
||||
src/python/gi/overrides/BlockDev.py | 19 +++++++++++++++++--
|
||||
tests/swap_test.py | 13 +++++++++++++
|
||||
5 files changed, 43 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/lib/plugin_apis/swap.api b/src/lib/plugin_apis/swap.api
|
||||
index d0906fe..3fcc0e5 100644
|
||||
--- a/src/lib/plugin_apis/swap.api
|
||||
+++ b/src/lib/plugin_apis/swap.api
|
||||
@@ -10,6 +10,10 @@ typedef enum {
|
||||
BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
BD_SWAP_ERROR_ACTIVATE,
|
||||
BD_SWAP_ERROR_TECH_UNAVAIL,
|
||||
+ BD_SWAP_ERROR_ACTIVATE_OLD,
|
||||
+ BD_SWAP_ERROR_ACTIVATE_SUSPEND,
|
||||
+ BD_SWAP_ERROR_ACTIVATE_UNKNOWN,
|
||||
+ BD_SWAP_ERROR_ACTIVATE_PAGESIZE,
|
||||
} BDSwapError;
|
||||
|
||||
typedef enum {
|
||||
diff --git a/src/plugins/swap.c b/src/plugins/swap.c
|
||||
index bfe653f..28db6f3 100644
|
||||
--- a/src/plugins/swap.c
|
||||
+++ b/src/plugins/swap.c
|
||||
@@ -292,21 +292,21 @@ gboolean bd_swap_swapon (const gchar *device, gint priority, GError **error) {
|
||||
}
|
||||
|
||||
if (g_strcmp0 (value, "SWAP-SPACE") == 0) {
|
||||
- g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_ACTIVATE,
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_ACTIVATE_OLD,
|
||||
"Old swap format, cannot activate.");
|
||||
bd_utils_report_finished (progress_id, (*error)->message);
|
||||
blkid_free_probe (probe);
|
||||
close (fd);
|
||||
return FALSE;
|
||||
} else if (g_strcmp0 (value, "S1SUSPEND") == 0 || g_strcmp0 (value, "S2SUSPEND") == 0) {
|
||||
- g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_ACTIVATE,
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_ACTIVATE_SUSPEND,
|
||||
"Suspended system on the swap device, cannot activate.");
|
||||
bd_utils_report_finished (progress_id, (*error)->message);
|
||||
blkid_free_probe (probe);
|
||||
close (fd);
|
||||
return FALSE;
|
||||
} else if (g_strcmp0 (value, "SWAPSPACE2") != 0) {
|
||||
- g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_ACTIVATE,
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_ACTIVATE_UNKNOWN,
|
||||
"Unknown swap space format, cannot activate.");
|
||||
bd_utils_report_finished (progress_id, (*error)->message);
|
||||
blkid_free_probe (probe);
|
||||
@@ -318,7 +318,7 @@ gboolean bd_swap_swapon (const gchar *device, gint priority, GError **error) {
|
||||
|
||||
status = blkid_probe_lookup_value (probe, "SBMAGIC_OFFSET", &value, NULL);
|
||||
if (status != 0 || !value) {
|
||||
- g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_ACTIVATE_PAGESIZE,
|
||||
"Failed to get swap status on the device '%s'", device);
|
||||
bd_utils_report_finished (progress_id, (*error)->message);
|
||||
blkid_free_probe (probe);
|
||||
@@ -334,7 +334,7 @@ gboolean bd_swap_swapon (const gchar *device, gint priority, GError **error) {
|
||||
sys_pagesize = getpagesize ();
|
||||
|
||||
if (swap_pagesize != sys_pagesize) {
|
||||
- g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
+ g_set_error (error, BD_SWAP_ERROR, BD_SWAP_ERROR_ACTIVATE_PAGESIZE,
|
||||
"Swap format pagesize (%"G_GINT64_FORMAT") and system pagesize (%"G_GINT64_FORMAT") don't match",
|
||||
swap_pagesize, sys_pagesize);
|
||||
bd_utils_report_finished (progress_id, (*error)->message);
|
||||
diff --git a/src/plugins/swap.h b/src/plugins/swap.h
|
||||
index a01c873..9947bad 100644
|
||||
--- a/src/plugins/swap.h
|
||||
+++ b/src/plugins/swap.h
|
||||
@@ -12,6 +12,10 @@ typedef enum {
|
||||
BD_SWAP_ERROR_UNKNOWN_STATE,
|
||||
BD_SWAP_ERROR_ACTIVATE,
|
||||
BD_SWAP_ERROR_TECH_UNAVAIL,
|
||||
+ BD_SWAP_ERROR_ACTIVATE_OLD,
|
||||
+ BD_SWAP_ERROR_ACTIVATE_SUSPEND,
|
||||
+ BD_SWAP_ERROR_ACTIVATE_UNKNOWN,
|
||||
+ BD_SWAP_ERROR_ACTIVATE_PAGESIZE,
|
||||
} BDSwapError;
|
||||
|
||||
typedef enum {
|
||||
diff --git a/src/python/gi/overrides/BlockDev.py b/src/python/gi/overrides/BlockDev.py
|
||||
index c2ef2f4..e608887 100644
|
||||
--- a/src/python/gi/overrides/BlockDev.py
|
||||
+++ b/src/python/gi/overrides/BlockDev.py
|
||||
@@ -1031,7 +1031,17 @@ __all__.append("MpathError")
|
||||
|
||||
class SwapError(BlockDevError):
|
||||
pass
|
||||
-__all__.append("SwapError")
|
||||
+class SwapActivateError(SwapError):
|
||||
+ pass
|
||||
+class SwapOldError(SwapActivateError):
|
||||
+ pass
|
||||
+class SwapSuspendError(SwapActivateError):
|
||||
+ pass
|
||||
+class SwapUnknownError(SwapActivateError):
|
||||
+ pass
|
||||
+class SwapPagesizeError(SwapActivateError):
|
||||
+ pass
|
||||
+__all__.extend(("SwapError", "SwapActivateError", "SwapOldError", "SwapSuspendError", "SwapUnknownError", "SwapPagesizeError"))
|
||||
|
||||
class KbdError(BlockDevError):
|
||||
pass
|
||||
@@ -1070,6 +1080,11 @@ __all__.append("BlockDevNotImplementedError")
|
||||
not_implemented_rule = XRule(GLib.Error, re.compile(r".*The function '.*' called, but not implemented!"), None, BlockDevNotImplementedError)
|
||||
|
||||
fs_nofs_rule = XRule(GLib.Error, None, 3, FSNoFSError)
|
||||
+swap_activate_rule = XRule(GLib.Error, None, 1, SwapActivateError)
|
||||
+swap_old_rule = XRule(GLib.Error, None, 3, SwapOldError)
|
||||
+swap_suspend_rule = XRule(GLib.Error, None, 4, SwapSuspendError)
|
||||
+swap_unknown_rule = XRule(GLib.Error, None, 5, SwapUnknownError)
|
||||
+swap_pagesize_rule = XRule(GLib.Error, None, 6, SwapPagesizeError)
|
||||
|
||||
btrfs = ErrorProxy("btrfs", BlockDev, [(GLib.Error, BtrfsError)], [not_implemented_rule])
|
||||
__all__.append("btrfs")
|
||||
@@ -1092,7 +1107,7 @@ __all__.append("md")
|
||||
mpath = ErrorProxy("mpath", BlockDev, [(GLib.Error, MpathError)], [not_implemented_rule])
|
||||
__all__.append("mpath")
|
||||
|
||||
-swap = ErrorProxy("swap", BlockDev, [(GLib.Error, SwapError)], [not_implemented_rule])
|
||||
+swap = ErrorProxy("swap", BlockDev, [(GLib.Error, SwapError)], [not_implemented_rule, swap_activate_rule, swap_old_rule, swap_suspend_rule, swap_unknown_rule, swap_pagesize_rule])
|
||||
__all__.append("swap")
|
||||
|
||||
kbd = ErrorProxy("kbd", BlockDev, [(GLib.Error, KbdError)], [not_implemented_rule])
|
||||
diff --git a/tests/swap_test.py b/tests/swap_test.py
|
||||
index 05d0c19..395fdf5 100644
|
||||
--- a/tests/swap_test.py
|
||||
+++ b/tests/swap_test.py
|
||||
@@ -97,6 +97,19 @@ class SwapTestCase(SwapTest):
|
||||
_ret, out, _err = run_command("blkid -ovalue -sLABEL -p %s" % self.loop_dev)
|
||||
self.assertEqual(out, "BlockDevSwap")
|
||||
|
||||
+ def test_swapon_pagesize(self):
|
||||
+ """Verify that activating swap with different pagesize fails"""
|
||||
+
|
||||
+ # create swap with 64k pagesize
|
||||
+ ret, out, err = run_command("mkswap --pagesize 65536 %s" % self.loop_dev)
|
||||
+ if ret != 0:
|
||||
+ self.fail("Failed to prepare swap for pagesize test: %s %s" % (out, err))
|
||||
+
|
||||
+ # activation should fail because swap has different pagesize
|
||||
+ with self.assertRaises(BlockDev.SwapPagesizeError):
|
||||
+ BlockDev.swap.swapon(self.loop_dev)
|
||||
+
|
||||
+
|
||||
class SwapUnloadTest(SwapTest):
|
||||
def setUp(self):
|
||||
# make sure the library is initialized with all plugins loaded for other
|
||||
--
|
||||
2.17.1
|
||||
|
||||
53
SOURCES/0002-major-minor-macros.patch
Normal file
53
SOURCES/0002-major-minor-macros.patch
Normal file
@ -0,0 +1,53 @@
|
||||
From f5585f5839b51e734d28059f8a6b6d92ce036d93 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Mon, 17 Dec 2018 10:36:49 +0100
|
||||
Subject: [PATCH] Use major/minor macros from sys/sysmacros.h instead of
|
||||
linux/kdev_t.h
|
||||
|
||||
The macros from linux/kdev_t.h don't work for devices with
|
||||
minor > 255.
|
||||
|
||||
Resolves: rhbz#1644825
|
||||
---
|
||||
src/plugins/mpath.c | 14 +++++++-------
|
||||
1 file changed, 7 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/mpath.c b/src/plugins/mpath.c
|
||||
index 4fb75849..639c00b9 100644
|
||||
--- a/src/plugins/mpath.c
|
||||
+++ b/src/plugins/mpath.c
|
||||
@@ -18,8 +18,8 @@
|
||||
*/
|
||||
|
||||
#include <glib.h>
|
||||
-/* provides MAJOR, MINOR macros */
|
||||
-#include <linux/kdev_t.h>
|
||||
+/* provides major and minor macros */
|
||||
+#include <sys/sysmacros.h>
|
||||
#include <libdevmapper.h>
|
||||
#include <unistd.h>
|
||||
#include <blockdev/utils.h>
|
||||
@@ -273,8 +273,8 @@ static gboolean map_is_multipath (const gchar *map_name, GError **error) {
|
||||
static gchar** get_map_deps (const gchar *map_name, guint64 *n_deps, GError **error) {
|
||||
struct dm_task *task;
|
||||
struct dm_deps *deps;
|
||||
- guint64 major = 0;
|
||||
- guint64 minor = 0;
|
||||
+ guint64 dev_major = 0;
|
||||
+ guint64 dev_minor = 0;
|
||||
guint64 i = 0;
|
||||
gchar **dep_devs = NULL;
|
||||
gchar *major_minor = NULL;
|
||||
@@ -319,9 +319,9 @@ static gchar** get_map_deps (const gchar *map_name, guint64 *n_deps, GError **er
|
||||
dep_devs = g_new0 (gchar*, deps->count + 1);
|
||||
|
||||
for (i = 0; i < deps->count; i++) {
|
||||
- major = (guint64) MAJOR(deps->device[i]);
|
||||
- minor = (guint64) MINOR(deps->device[i]);
|
||||
- major_minor = g_strdup_printf ("%"G_GUINT64_FORMAT":%"G_GUINT64_FORMAT, major, minor);
|
||||
+ dev_major = (guint64) major (deps->device[i]);
|
||||
+ dev_minor = (guint64) minor (deps->device[i]);
|
||||
+ major_minor = g_strdup_printf ("%"G_GUINT64_FORMAT":%"G_GUINT64_FORMAT, dev_major, dev_minor);
|
||||
dep_devs[i] = get_device_name (major_minor, error);
|
||||
if (*error) {
|
||||
g_prefix_error (error, "Failed to resolve '%s' to device name",
|
||||
@ -1,41 +0,0 @@
|
||||
From 6700dfded31219c99fea054aa10fd68b90bace82 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Mon, 31 Oct 2022 12:43:17 +0100
|
||||
Subject: [PATCH] tests: Fix test_swapon_pagesize on systems with 64k pages
|
||||
|
||||
---
|
||||
tests/swap_test.py | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/swap_test.py b/tests/swap_test.py
|
||||
index 0a0f333d..e350f8e8 100644
|
||||
--- a/tests/swap_test.py
|
||||
+++ b/tests/swap_test.py
|
||||
@@ -1,5 +1,6 @@
|
||||
import unittest
|
||||
import os
|
||||
+import resource
|
||||
import overrides_hack
|
||||
|
||||
from utils import create_sparse_tempfile, create_lio_device, delete_lio_device, fake_utils, fake_path, run_command, run, TestTags, tag_test
|
||||
@@ -102,8 +103,15 @@ class SwapTestCase(SwapTest):
|
||||
def test_swapon_pagesize(self):
|
||||
"""Verify that activating swap with different pagesize fails"""
|
||||
|
||||
- # create swap with 64k pagesize
|
||||
- ret, out, err = run_command("mkswap --pagesize 65536 %s" % self.loop_dev)
|
||||
+ # pick some wrong page size: 8k on 64k and 64k everywhere else
|
||||
+ pagesize = resource.getpagesize()
|
||||
+ if pagesize == 65536:
|
||||
+ wrong_pagesize = 8192
|
||||
+ else:
|
||||
+ wrong_pagesize = 65536
|
||||
+
|
||||
+ # create swap with "wrong" pagesize
|
||||
+ ret, out, err = run_command("mkswap --pagesize %s %s" % (wrong_pagesize, self.loop_dev))
|
||||
if ret != 0:
|
||||
self.fail("Failed to prepare swap for pagesize test: %s %s" % (out, err))
|
||||
|
||||
--
|
||||
2.39.2
|
||||
|
||||
2676
SOURCES/0003-gating-tests-changes.patch
Normal file
2676
SOURCES/0003-gating-tests-changes.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,32 +0,0 @@
|
||||
From 9c96e621e9abb0649118d2e1731a09b1fa139579 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Wed, 19 Apr 2023 09:50:38 +0200
|
||||
Subject: [PATCH] part: Fix segfault when adding a partition too big for MSDOS
|
||||
|
||||
Resolves: rhbz#2185564
|
||||
---
|
||||
src/plugins/part.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
diff --git a/src/plugins/part.c b/src/plugins/part.c
|
||||
index 8b2285f5..28e20c28 100644
|
||||
--- a/src/plugins/part.c
|
||||
+++ b/src/plugins/part.c
|
||||
@@ -841,6 +841,14 @@ static gboolean resize_part (PedPartition *part, PedDevice *dev, PedDisk *disk,
|
||||
constr = ped_constraint_any (dev);
|
||||
|
||||
geom = ped_disk_get_max_partition_geometry (disk, part, constr);
|
||||
+ if (!geom) {
|
||||
+ set_parted_error (error, BD_PART_ERROR_FAIL);
|
||||
+ g_prefix_error (error, "Failed to create geometry for partition on device '%s'", dev->path);
|
||||
+ ped_constraint_destroy (constr);
|
||||
+ finish_alignment_constraint (disk, orig_flag_state);
|
||||
+ return FALSE;
|
||||
+ }
|
||||
+
|
||||
if (!ped_geometry_set_start (geom, start)) {
|
||||
set_parted_error (error, BD_PART_ERROR_FAIL);
|
||||
g_prefix_error (error, "Failed to set partition start on device '%s'", dev->path);
|
||||
--
|
||||
2.40.1
|
||||
|
||||
@ -1,300 +0,0 @@
|
||||
From ee9c3afec5ef2fe1e9fd50718cd732e267b235ed Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Mon, 24 Apr 2023 11:57:18 +0200
|
||||
Subject: [PATCH] lvm: Add a function to activate LVs in shared mode
|
||||
|
||||
Needed by the new blivet feature to support shared LVM setups.
|
||||
---
|
||||
src/lib/plugin_apis/lvm.api | 16 +++++++++
|
||||
src/plugins/lvm-dbus.c | 51 ++++++++++++++++++++-------
|
||||
src/plugins/lvm.c | 53 ++++++++++++++++++++++-------
|
||||
src/plugins/lvm.h | 1 +
|
||||
src/python/gi/overrides/BlockDev.py | 5 ++-
|
||||
tests/lvm_dbus_tests.py | 18 +++++++---
|
||||
tests/lvm_test.py | 18 +++++++---
|
||||
7 files changed, 124 insertions(+), 38 deletions(-)
|
||||
|
||||
diff --git a/src/lib/plugin_apis/lvm.api b/src/lib/plugin_apis/lvm.api
|
||||
index dc8c1348..bac70a75 100644
|
||||
--- a/src/lib/plugin_apis/lvm.api
|
||||
+++ b/src/lib/plugin_apis/lvm.api
|
||||
@@ -1055,6 +1055,22 @@ gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 si
|
||||
*/
|
||||
gboolean bd_lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, const BDExtraArg **extra, GError **error);
|
||||
|
||||
+/**
|
||||
+ * bd_lvm_lvactivate_shared:
|
||||
+ * @vg_name: name of the VG containing the to-be-activated LV
|
||||
+ * @lv_name: name of the to-be-activated LV
|
||||
+ * @ignore_skip: whether to ignore the skip flag or not
|
||||
+ * @shared: whether to activate the LV in shared mode
|
||||
+ * @extra: (allow-none) (array zero-terminated=1): extra options for the LV activation
|
||||
+ * (just passed to LVM as is)
|
||||
+ * @error: (out): place to store error (if any)
|
||||
+ *
|
||||
+ * Returns: whether the @vg_name/@lv_name LV was successfully activated or not
|
||||
+ *
|
||||
+ * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
|
||||
+ */
|
||||
+gboolean bd_lvm_lvactivate_shared (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error);
|
||||
+
|
||||
/**
|
||||
* bd_lvm_lvdeactivate:
|
||||
* @vg_name: name of the VG containing the to-be-deactivated LV
|
||||
diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c
|
||||
index b7b4480e..d8e997f9 100644
|
||||
--- a/src/plugins/lvm-dbus.c
|
||||
+++ b/src/plugins/lvm-dbus.c
|
||||
@@ -2115,6 +2115,27 @@ gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 si
|
||||
return (*error == NULL);
|
||||
}
|
||||
|
||||
+static gboolean _lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error) {
|
||||
+ GVariant *params = NULL;
|
||||
+ GVariantBuilder builder;
|
||||
+ GVariant *extra_params = NULL;
|
||||
+
|
||||
+ if (shared)
|
||||
+ params = g_variant_new ("(t)", (guint64) 1 << 6);
|
||||
+ else
|
||||
+ params = g_variant_new ("(t)", (guint64) 0);
|
||||
+
|
||||
+ if (ignore_skip) {
|
||||
+ g_variant_builder_init (&builder, G_VARIANT_TYPE_DICTIONARY);
|
||||
+ g_variant_builder_add (&builder, "{sv}", "-K", g_variant_new ("s", ""));
|
||||
+ extra_params = g_variant_builder_end (&builder);
|
||||
+ g_variant_builder_clear (&builder);
|
||||
+ }
|
||||
+ call_lv_method_sync (vg_name, lv_name, "Activate", params, extra_params, extra, TRUE, error);
|
||||
+
|
||||
+ return (*error == NULL);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* bd_lvm_lvactivate:
|
||||
* @vg_name: name of the VG containing the to-be-activated LV
|
||||
@@ -2129,19 +2150,25 @@ gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 si
|
||||
* Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
|
||||
*/
|
||||
gboolean bd_lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, const BDExtraArg **extra, GError **error) {
|
||||
- GVariant *params = g_variant_new ("(t)", (guint64) 0);
|
||||
- GVariantBuilder builder;
|
||||
- GVariant *extra_params = NULL;
|
||||
-
|
||||
- if (ignore_skip) {
|
||||
- g_variant_builder_init (&builder, G_VARIANT_TYPE_DICTIONARY);
|
||||
- g_variant_builder_add (&builder, "{sv}", "-K", g_variant_new ("s", ""));
|
||||
- extra_params = g_variant_builder_end (&builder);
|
||||
- g_variant_builder_clear (&builder);
|
||||
- }
|
||||
- call_lv_method_sync (vg_name, lv_name, "Activate", params, extra_params, extra, TRUE, error);
|
||||
+ return _lvm_lvactivate (vg_name, lv_name, ignore_skip, FALSE, extra, error);
|
||||
+}
|
||||
|
||||
- return (*error == NULL);
|
||||
+/**
|
||||
+ * bd_lvm_lvactivate_shared:
|
||||
+ * @vg_name: name of the VG containing the to-be-activated LV
|
||||
+ * @lv_name: name of the to-be-activated LV
|
||||
+ * @ignore_skip: whether to ignore the skip flag or not
|
||||
+ * @shared: whether to activate the LV in shared mode
|
||||
+ * @extra: (allow-none) (array zero-terminated=1): extra options for the LV activation
|
||||
+ * (just passed to LVM as is)
|
||||
+ * @error: (out): place to store error (if any)
|
||||
+ *
|
||||
+ * Returns: whether the @vg_name/@lv_name LV was successfully activated or not
|
||||
+ *
|
||||
+ * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
|
||||
+ */
|
||||
+gboolean bd_lvm_lvactivate_shared (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error) {
|
||||
+ return _lvm_lvactivate (vg_name, lv_name, ignore_skip, shared, extra, error);
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c
|
||||
index 50da656c..d7281339 100644
|
||||
--- a/src/plugins/lvm.c
|
||||
+++ b/src/plugins/lvm.c
|
||||
@@ -1594,6 +1594,28 @@ gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 si
|
||||
return success;
|
||||
}
|
||||
|
||||
+static gboolean _lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error) {
|
||||
+ const gchar *args[5] = {"lvchange", NULL, NULL, NULL, NULL};
|
||||
+ guint8 next_arg = 2;
|
||||
+ gboolean success = FALSE;
|
||||
+
|
||||
+ if (shared)
|
||||
+ args[1] = "-asy";
|
||||
+ else
|
||||
+ args[1] = "-ay";
|
||||
+
|
||||
+ if (ignore_skip) {
|
||||
+ args[next_arg] = "-K";
|
||||
+ next_arg++;
|
||||
+ }
|
||||
+ args[next_arg] = g_strdup_printf ("%s/%s", vg_name, lv_name);
|
||||
+
|
||||
+ success = call_lvm_and_report_error (args, extra, TRUE, error);
|
||||
+ g_free ((gchar *) args[next_arg]);
|
||||
+
|
||||
+ return success;
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* bd_lvm_lvactivate:
|
||||
* @vg_name: name of the VG containing the to-be-activated LV
|
||||
@@ -1608,20 +1630,25 @@ gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 si
|
||||
* Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
|
||||
*/
|
||||
gboolean bd_lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, const BDExtraArg **extra, GError **error) {
|
||||
- const gchar *args[5] = {"lvchange", "-ay", NULL, NULL, NULL};
|
||||
- guint8 next_arg = 2;
|
||||
- gboolean success = FALSE;
|
||||
-
|
||||
- if (ignore_skip) {
|
||||
- args[next_arg] = "-K";
|
||||
- next_arg++;
|
||||
- }
|
||||
- args[next_arg] = g_strdup_printf ("%s/%s", vg_name, lv_name);
|
||||
-
|
||||
- success = call_lvm_and_report_error (args, extra, TRUE, error);
|
||||
- g_free ((gchar *) args[next_arg]);
|
||||
+ return _lvm_lvactivate (vg_name, lv_name, ignore_skip, FALSE, extra, error);
|
||||
+}
|
||||
|
||||
- return success;
|
||||
+/**
|
||||
+ * bd_lvm_lvactivate_shared:
|
||||
+ * @vg_name: name of the VG containing the to-be-activated LV
|
||||
+ * @lv_name: name of the to-be-activated LV
|
||||
+ * @ignore_skip: whether to ignore the skip flag or not
|
||||
+ * @shared: whether to activate the LV in shared mode
|
||||
+ * @extra: (allow-none) (array zero-terminated=1): extra options for the LV activation
|
||||
+ * (just passed to LVM as is)
|
||||
+ * @error: (out): place to store error (if any)
|
||||
+ *
|
||||
+ * Returns: whether the @vg_name/@lv_name LV was successfully activated or not
|
||||
+ *
|
||||
+ * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
|
||||
+ */
|
||||
+gboolean bd_lvm_lvactivate_shared (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error) {
|
||||
+ return _lvm_lvactivate (vg_name, lv_name, ignore_skip, shared, extra, error);
|
||||
}
|
||||
|
||||
/**
|
||||
diff --git a/src/plugins/lvm.h b/src/plugins/lvm.h
|
||||
index 2162d769..244663a4 100644
|
||||
--- a/src/plugins/lvm.h
|
||||
+++ b/src/plugins/lvm.h
|
||||
@@ -275,6 +275,7 @@ gboolean bd_lvm_lvremove (const gchar *vg_name, const gchar *lv_name, gboolean f
|
||||
gboolean bd_lvm_lvrename (const gchar *vg_name, const gchar *lv_name, const gchar *new_name, const BDExtraArg **extra, GError **error);
|
||||
gboolean bd_lvm_lvresize (const gchar *vg_name, const gchar *lv_name, guint64 size, const BDExtraArg **extra, GError **error);
|
||||
gboolean bd_lvm_lvactivate (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, const BDExtraArg **extra, GError **error);
|
||||
+gboolean bd_lvm_lvactivate_shared (const gchar *vg_name, const gchar *lv_name, gboolean ignore_skip, gboolean shared, const BDExtraArg **extra, GError **error);
|
||||
gboolean bd_lvm_lvdeactivate (const gchar *vg_name, const gchar *lv_name, const BDExtraArg **extra, GError **error);
|
||||
gboolean bd_lvm_lvsnapshotcreate (const gchar *vg_name, const gchar *origin_name, const gchar *snapshot_name, guint64 size, const BDExtraArg **extra, GError **error);
|
||||
gboolean bd_lvm_lvsnapshotmerge (const gchar *vg_name, const gchar *snapshot_name, const BDExtraArg **extra, GError **error);
|
||||
diff --git a/src/python/gi/overrides/BlockDev.py b/src/python/gi/overrides/BlockDev.py
|
||||
index f768c8bd..c7d72f4b 100644
|
||||
--- a/src/python/gi/overrides/BlockDev.py
|
||||
+++ b/src/python/gi/overrides/BlockDev.py
|
||||
@@ -580,11 +580,10 @@ def lvm_lvresize(vg_name, lv_name, size, extra=None, **kwargs):
|
||||
return _lvm_lvresize(vg_name, lv_name, size, extra)
|
||||
__all__.append("lvm_lvresize")
|
||||
|
||||
-_lvm_lvactivate = BlockDev.lvm_lvactivate
|
||||
@override(BlockDev.lvm_lvactivate)
|
||||
-def lvm_lvactivate(vg_name, lv_name, ignore_skip=False, extra=None, **kwargs):
|
||||
+def lvm_lvactivate(vg_name, lv_name, ignore_skip=False, shared=False, extra=None, **kwargs):
|
||||
extra = _get_extra(extra, kwargs)
|
||||
- return _lvm_lvactivate(vg_name, lv_name, ignore_skip, extra)
|
||||
+ return BlockDev.lvm_lvactivate_shared(vg_name, lv_name, ignore_skip, shared, extra)
|
||||
__all__.append("lvm_lvactivate")
|
||||
|
||||
_lvm_lvdeactivate = BlockDev.lvm_lvdeactivate
|
||||
diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py
|
||||
index 4882da88..67eaccd1 100644
|
||||
--- a/tests/lvm_dbus_tests.py
|
||||
+++ b/tests/lvm_dbus_tests.py
|
||||
@@ -799,15 +799,15 @@ class LvmTestLVactivateDeactivate(LvmPVVGLVTestCase):
|
||||
self.assertTrue(succ)
|
||||
|
||||
with self.assertRaises(GLib.GError):
|
||||
- BlockDev.lvm_lvactivate("nonexistingVG", "testLV", True, None)
|
||||
+ BlockDev.lvm_lvactivate("nonexistingVG", "testLV", True)
|
||||
|
||||
with self.assertRaises(GLib.GError):
|
||||
- BlockDev.lvm_lvactivate("testVG", "nonexistingLV", True, None)
|
||||
+ BlockDev.lvm_lvactivate("testVG", "nonexistingLV", True)
|
||||
|
||||
with self.assertRaises(GLib.GError):
|
||||
- BlockDev.lvm_lvactivate("nonexistingVG", "nonexistingLV", True, None)
|
||||
+ BlockDev.lvm_lvactivate("nonexistingVG", "nonexistingLV", True)
|
||||
|
||||
- succ = BlockDev.lvm_lvactivate("testVG", "testLV", True, None)
|
||||
+ succ = BlockDev.lvm_lvactivate("testVG", "testLV", True)
|
||||
self.assertTrue(succ)
|
||||
|
||||
with self.assertRaises(GLib.GError):
|
||||
@@ -822,7 +822,15 @@ class LvmTestLVactivateDeactivate(LvmPVVGLVTestCase):
|
||||
succ = BlockDev.lvm_lvdeactivate("testVG", "testLV", None)
|
||||
self.assertTrue(succ)
|
||||
|
||||
- succ = BlockDev.lvm_lvactivate("testVG", "testLV", True, None)
|
||||
+ succ = BlockDev.lvm_lvactivate("testVG", "testLV", True)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ succ = BlockDev.lvm_lvdeactivate("testVG", "testLV", None)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ # try activating in shared mode, unfortunately no way to check whether it really
|
||||
+ # works or not
|
||||
+ succ = BlockDev.lvm_lvactivate("testVG", "testLV", True, True)
|
||||
self.assertTrue(succ)
|
||||
|
||||
succ = BlockDev.lvm_lvdeactivate("testVG", "testLV", None)
|
||||
diff --git a/tests/lvm_test.py b/tests/lvm_test.py
|
||||
index eb94c917..25e2f109 100644
|
||||
--- a/tests/lvm_test.py
|
||||
+++ b/tests/lvm_test.py
|
||||
@@ -730,15 +730,15 @@ class LvmTestLVactivateDeactivate(LvmPVVGLVTestCase):
|
||||
self.assertTrue(succ)
|
||||
|
||||
with self.assertRaises(GLib.GError):
|
||||
- BlockDev.lvm_lvactivate("nonexistingVG", "testLV", True, None)
|
||||
+ BlockDev.lvm_lvactivate("nonexistingVG", "testLV", True)
|
||||
|
||||
with self.assertRaises(GLib.GError):
|
||||
- BlockDev.lvm_lvactivate("testVG", "nonexistingLV", True, None)
|
||||
+ BlockDev.lvm_lvactivate("testVG", "nonexistingLV", True)
|
||||
|
||||
with self.assertRaises(GLib.GError):
|
||||
- BlockDev.lvm_lvactivate("nonexistingVG", "nonexistingLV", True, None)
|
||||
+ BlockDev.lvm_lvactivate("nonexistingVG", "nonexistingLV", True)
|
||||
|
||||
- succ = BlockDev.lvm_lvactivate("testVG", "testLV", True, None)
|
||||
+ succ = BlockDev.lvm_lvactivate("testVG", "testLV", True)
|
||||
self.assertTrue(succ)
|
||||
|
||||
with self.assertRaises(GLib.GError):
|
||||
@@ -753,7 +753,15 @@ class LvmTestLVactivateDeactivate(LvmPVVGLVTestCase):
|
||||
succ = BlockDev.lvm_lvdeactivate("testVG", "testLV", None)
|
||||
self.assertTrue(succ)
|
||||
|
||||
- succ = BlockDev.lvm_lvactivate("testVG", "testLV", True, None)
|
||||
+ succ = BlockDev.lvm_lvactivate("testVG", "testLV", True)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ succ = BlockDev.lvm_lvdeactivate("testVG", "testLV", None)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ # try activating in shared mode, unfortunately no way to check whether it really
|
||||
+ # works or not
|
||||
+ succ = BlockDev.lvm_lvactivate("testVG", "testLV", True, True)
|
||||
self.assertTrue(succ)
|
||||
|
||||
succ = BlockDev.lvm_lvdeactivate("testVG", "testLV", None)
|
||||
--
|
||||
2.41.0
|
||||
|
||||
914
SOURCES/0004-memory-leaks.patch
Normal file
914
SOURCES/0004-memory-leaks.patch
Normal file
@ -0,0 +1,914 @@
|
||||
From 0789fc7f227b557d9633402bf9971ff7a6360447 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Wed, 24 Apr 2019 16:03:31 +0200
|
||||
Subject: [PATCH 01/17] lvm: Fix some obvious memory leaks
|
||||
|
||||
---
|
||||
src/plugins/lvm.c | 7 +++++++
|
||||
1 file changed, 7 insertions(+)
|
||||
|
||||
diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c
|
||||
index 87ff5a4..a23f8fd 100644
|
||||
--- a/src/plugins/lvm.c
|
||||
+++ b/src/plugins/lvm.c
|
||||
@@ -371,6 +371,7 @@ static GHashTable* parse_lvm_vars (const gchar *str, guint *num_items) {
|
||||
if (g_strv_length (key_val) == 2) {
|
||||
/* we only want to process valid lines (with the '=' character) */
|
||||
g_hash_table_insert (table, key_val[0], key_val[1]);
|
||||
+ g_free (key_val);
|
||||
(*num_items)++;
|
||||
} else
|
||||
/* invalid line, just free key_val */
|
||||
@@ -972,6 +973,7 @@ BDLVMPVdata* bd_lvm_pvinfo (const gchar *device, GError **error) {
|
||||
if (table)
|
||||
g_hash_table_destroy (table);
|
||||
}
|
||||
+ g_strfreev (lines);
|
||||
|
||||
/* getting here means no usable info was found */
|
||||
g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_PARSE,
|
||||
@@ -1039,6 +1041,7 @@ BDLVMPVdata** bd_lvm_pvs (GError **error) {
|
||||
if (pvs->len == 0) {
|
||||
g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_PARSE,
|
||||
"Failed to parse information about PVs");
|
||||
+ g_ptr_array_free (pvs, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1247,6 +1250,7 @@ BDLVMVGdata* bd_lvm_vginfo (const gchar *vg_name, GError **error) {
|
||||
if (table)
|
||||
g_hash_table_destroy (table);
|
||||
}
|
||||
+ g_strfreev (lines);
|
||||
|
||||
/* getting here means no usable info was found */
|
||||
g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_PARSE,
|
||||
@@ -1312,6 +1316,7 @@ BDLVMVGdata** bd_lvm_vgs (GError **error) {
|
||||
if (vgs->len == 0) {
|
||||
g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_PARSE,
|
||||
"Failed to parse information about VGs");
|
||||
+ g_ptr_array_free (vgs, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1641,6 +1646,7 @@ BDLVMLVdata* bd_lvm_lvinfo (const gchar *vg_name, const gchar *lv_name, GError *
|
||||
if (table)
|
||||
g_hash_table_destroy (table);
|
||||
}
|
||||
+ g_strfreev (lines);
|
||||
|
||||
/* getting here means no usable info was found */
|
||||
g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_PARSE,
|
||||
@@ -1713,6 +1719,7 @@ BDLVMLVdata** bd_lvm_lvs (const gchar *vg_name, GError **error) {
|
||||
if (lvs->len == 0) {
|
||||
g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_PARSE,
|
||||
"Failed to parse information about LVs");
|
||||
+ g_ptr_array_free (lvs, FALSE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 552173cfcb77d9ed3476b55e0170627998081912 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Wed, 24 Apr 2019 16:27:07 +0200
|
||||
Subject: [PATCH 02/17] lvm: Use g_ptr_array_free() for creating lists
|
||||
|
||||
No need to allocate separate array and copy elements one by one, use
|
||||
g_ptr_array_free() instead and only add the trailing NULL element as
|
||||
a regular item.
|
||||
|
||||
This fixes leaks of the array shell.
|
||||
---
|
||||
src/plugins/lvm.c | 88 ++++++++++++++++++++---------------------------
|
||||
1 file changed, 37 insertions(+), 51 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c
|
||||
index a23f8fd..c2f2bf8 100644
|
||||
--- a/src/plugins/lvm.c
|
||||
+++ b/src/plugins/lvm.c
|
||||
@@ -1001,24 +1001,25 @@ BDLVMPVdata** bd_lvm_pvs (GError **error) {
|
||||
gchar **lines = NULL;
|
||||
gchar **lines_p = NULL;
|
||||
guint num_items;
|
||||
- GPtrArray *pvs = g_ptr_array_new ();
|
||||
+ GPtrArray *pvs;
|
||||
BDLVMPVdata *pvdata = NULL;
|
||||
- BDLVMPVdata **ret = NULL;
|
||||
- guint64 i = 0;
|
||||
|
||||
- success = call_lvm_and_capture_output (args, NULL, &output, error);
|
||||
+ pvs = g_ptr_array_new ();
|
||||
|
||||
+ success = call_lvm_and_capture_output (args, NULL, &output, error);
|
||||
if (!success) {
|
||||
if (g_error_matches (*error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_NOOUT)) {
|
||||
/* no output => no VGs, not an error */
|
||||
g_clear_error (error);
|
||||
- ret = g_new0 (BDLVMPVdata*, 1);
|
||||
- ret[0] = NULL;
|
||||
- return ret;
|
||||
+ /* return an empty list */
|
||||
+ g_ptr_array_add (pvs, NULL);
|
||||
+ return (BDLVMPVdata **) g_ptr_array_free (pvs, FALSE);
|
||||
}
|
||||
- else
|
||||
+ else {
|
||||
/* the error is already populated from the call */
|
||||
+ g_ptr_array_free (pvs, TRUE);
|
||||
return NULL;
|
||||
+ }
|
||||
}
|
||||
|
||||
lines = g_strsplit (output, "\n", 0);
|
||||
@@ -1045,15 +1046,9 @@ BDLVMPVdata** bd_lvm_pvs (GError **error) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- /* now create the return value -- NULL-terminated array of BDLVMPVdata */
|
||||
- ret = g_new0 (BDLVMPVdata*, pvs->len + 1);
|
||||
- for (i=0; i < pvs->len; i++)
|
||||
- ret[i] = (BDLVMPVdata*) g_ptr_array_index (pvs, i);
|
||||
- ret[i] = NULL;
|
||||
-
|
||||
- g_ptr_array_free (pvs, FALSE);
|
||||
-
|
||||
- return ret;
|
||||
+ /* returning NULL-terminated array of BDLVMPVdata */
|
||||
+ g_ptr_array_add (pvs, NULL);
|
||||
+ return (BDLVMPVdata **) g_ptr_array_free (pvs, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1277,23 +1272,25 @@ BDLVMVGdata** bd_lvm_vgs (GError **error) {
|
||||
gchar **lines = NULL;
|
||||
gchar **lines_p = NULL;
|
||||
guint num_items;
|
||||
- GPtrArray *vgs = g_ptr_array_new ();
|
||||
+ GPtrArray *vgs;
|
||||
BDLVMVGdata *vgdata = NULL;
|
||||
- BDLVMVGdata **ret = NULL;
|
||||
- guint64 i = 0;
|
||||
+
|
||||
+ vgs = g_ptr_array_new ();
|
||||
|
||||
success = call_lvm_and_capture_output (args, NULL, &output, error);
|
||||
if (!success) {
|
||||
if (g_error_matches (*error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_NOOUT)) {
|
||||
/* no output => no VGs, not an error */
|
||||
g_clear_error (error);
|
||||
- ret = g_new0 (BDLVMVGdata*, 1);
|
||||
- ret[0] = NULL;
|
||||
- return ret;
|
||||
+ /* return an empty list */
|
||||
+ g_ptr_array_add (vgs, NULL);
|
||||
+ return (BDLVMVGdata **) g_ptr_array_free (vgs, FALSE);
|
||||
}
|
||||
- else
|
||||
+ else {
|
||||
/* the error is already populated from the call */
|
||||
+ g_ptr_array_free (vgs, TRUE);
|
||||
return NULL;
|
||||
+ }
|
||||
}
|
||||
|
||||
lines = g_strsplit (output, "\n", 0);
|
||||
@@ -1320,15 +1317,9 @@ BDLVMVGdata** bd_lvm_vgs (GError **error) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- /* now create the return value -- NULL-terminated array of BDLVMVGdata */
|
||||
- ret = g_new0 (BDLVMVGdata*, vgs->len + 1);
|
||||
- for (i=0; i < vgs->len; i++)
|
||||
- ret[i] = (BDLVMVGdata*) g_ptr_array_index (vgs, i);
|
||||
- ret[i] = NULL;
|
||||
-
|
||||
- g_ptr_array_free (vgs, FALSE);
|
||||
-
|
||||
- return ret;
|
||||
+ /* returning NULL-terminated array of BDLVMVGdata */
|
||||
+ g_ptr_array_add (vgs, NULL);
|
||||
+ return (BDLVMVGdata **) g_ptr_array_free (vgs, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1676,27 +1667,28 @@ BDLVMLVdata** bd_lvm_lvs (const gchar *vg_name, GError **error) {
|
||||
gchar **lines = NULL;
|
||||
gchar **lines_p = NULL;
|
||||
guint num_items;
|
||||
- GPtrArray *lvs = g_ptr_array_new ();
|
||||
+ GPtrArray *lvs;
|
||||
BDLVMLVdata *lvdata = NULL;
|
||||
- BDLVMLVdata **ret = NULL;
|
||||
- guint64 i = 0;
|
||||
+
|
||||
+ lvs = g_ptr_array_new ();
|
||||
|
||||
if (vg_name)
|
||||
args[9] = vg_name;
|
||||
|
||||
success = call_lvm_and_capture_output (args, NULL, &output, error);
|
||||
-
|
||||
if (!success) {
|
||||
if (g_error_matches (*error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_NOOUT)) {
|
||||
/* no output => no LVs, not an error */
|
||||
g_clear_error (error);
|
||||
- ret = g_new0 (BDLVMLVdata*, 1);
|
||||
- ret[0] = NULL;
|
||||
- return ret;
|
||||
+ /* return an empty list */
|
||||
+ g_ptr_array_add (lvs, NULL);
|
||||
+ return (BDLVMLVdata **) g_ptr_array_free (lvs, FALSE);
|
||||
}
|
||||
- else
|
||||
+ else {
|
||||
/* the error is already populated from the call */
|
||||
+ g_ptr_array_free (lvs, TRUE);
|
||||
return NULL;
|
||||
+ }
|
||||
}
|
||||
|
||||
lines = g_strsplit (output, "\n", 0);
|
||||
@@ -1719,19 +1711,13 @@ BDLVMLVdata** bd_lvm_lvs (const gchar *vg_name, GError **error) {
|
||||
if (lvs->len == 0) {
|
||||
g_set_error (error, BD_LVM_ERROR, BD_LVM_ERROR_PARSE,
|
||||
"Failed to parse information about LVs");
|
||||
- g_ptr_array_free (lvs, FALSE);
|
||||
+ g_ptr_array_free (lvs, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- /* now create the return value -- NULL-terminated array of BDLVMLVdata */
|
||||
- ret = g_new0 (BDLVMLVdata*, lvs->len + 1);
|
||||
- for (i=0; i < lvs->len; i++)
|
||||
- ret[i] = (BDLVMLVdata*) g_ptr_array_index (lvs, i);
|
||||
- ret[i] = NULL;
|
||||
-
|
||||
- g_ptr_array_free (lvs, FALSE);
|
||||
-
|
||||
- return ret;
|
||||
+ /* returning NULL-terminated array of BDLVMLVdata */
|
||||
+ g_ptr_array_add (lvs, NULL);
|
||||
+ return (BDLVMLVdata **) g_ptr_array_free (lvs, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From fa48a6e64181e7becadbad8202be6de1829b4b9b Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Wed, 24 Apr 2019 16:31:52 +0200
|
||||
Subject: [PATCH 03/17] lvm: Fix leaking BDLVMPVdata.vg_uuid
|
||||
|
||||
---
|
||||
src/lib/plugin_apis/lvm.api | 2 ++
|
||||
src/plugins/lvm.c | 2 ++
|
||||
2 files changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/lib/plugin_apis/lvm.api b/src/lib/plugin_apis/lvm.api
|
||||
index ce47c51..bffe2ce 100644
|
||||
--- a/src/lib/plugin_apis/lvm.api
|
||||
+++ b/src/lib/plugin_apis/lvm.api
|
||||
@@ -114,6 +114,7 @@ BDLVMPVdata* bd_lvm_pvdata_copy (BDLVMPVdata *data) {
|
||||
new_data->pv_size = data->pv_size;
|
||||
new_data->pe_start = data->pe_start;
|
||||
new_data->vg_name = g_strdup (data->vg_name);
|
||||
+ new_data->vg_uuid = g_strdup (data->vg_uuid);
|
||||
new_data->vg_size = data->vg_size;
|
||||
new_data->vg_free = data->vg_free;
|
||||
new_data->vg_extent_size = data->vg_extent_size;
|
||||
@@ -136,6 +137,7 @@ void bd_lvm_pvdata_free (BDLVMPVdata *data) {
|
||||
g_free (data->pv_name);
|
||||
g_free (data->pv_uuid);
|
||||
g_free (data->vg_name);
|
||||
+ g_free (data->vg_uuid);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c
|
||||
index c2f2bf8..a6d738d 100644
|
||||
--- a/src/plugins/lvm.c
|
||||
+++ b/src/plugins/lvm.c
|
||||
@@ -63,6 +63,7 @@ BDLVMPVdata* bd_lvm_pvdata_copy (BDLVMPVdata *data) {
|
||||
new_data->pv_size = data->pv_size;
|
||||
new_data->pe_start = data->pe_start;
|
||||
new_data->vg_name = g_strdup (data->vg_name);
|
||||
+ new_data->vg_uuid = g_strdup (data->vg_uuid);
|
||||
new_data->vg_size = data->vg_size;
|
||||
new_data->vg_free = data->vg_free;
|
||||
new_data->vg_extent_size = data->vg_extent_size;
|
||||
@@ -80,6 +81,7 @@ void bd_lvm_pvdata_free (BDLVMPVdata *data) {
|
||||
g_free (data->pv_name);
|
||||
g_free (data->pv_uuid);
|
||||
g_free (data->vg_name);
|
||||
+ g_free (data->vg_uuid);
|
||||
g_free (data);
|
||||
}
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 1b44335a35d8d886f3a251f1c51d1f1039651d4e Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Wed, 24 Apr 2019 18:36:21 +0200
|
||||
Subject: [PATCH 04/17] exec: Fix some memory leaks
|
||||
|
||||
---
|
||||
src/utils/exec.c | 10 ++++++++--
|
||||
1 file changed, 8 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/src/utils/exec.c b/src/utils/exec.c
|
||||
index 28635a1..b1ca436 100644
|
||||
--- a/src/utils/exec.c
|
||||
+++ b/src/utils/exec.c
|
||||
@@ -228,8 +228,12 @@ gboolean bd_utils_exec_and_report_status_error (const gchar **argv, const BDExtr
|
||||
log_out (task_id, stdout_data, stderr_data);
|
||||
log_done (task_id, *status);
|
||||
|
||||
+ g_free (args);
|
||||
+
|
||||
if (!success) {
|
||||
/* error is already populated from the call */
|
||||
+ g_free (stdout_data);
|
||||
+ g_free (stderr_data);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -247,7 +251,6 @@ gboolean bd_utils_exec_and_report_status_error (const gchar **argv, const BDExtr
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
- g_free (args);
|
||||
g_free (stdout_data);
|
||||
g_free (stderr_data);
|
||||
return TRUE;
|
||||
@@ -398,14 +401,17 @@ gboolean bd_utils_exec_and_report_progress (const gchar **argv, const BDExtraArg
|
||||
G_SPAWN_DEFAULT|G_SPAWN_SEARCH_PATH|G_SPAWN_DO_NOT_REAP_CHILD,
|
||||
NULL, NULL, &pid, NULL, &out_fd, &err_fd, error);
|
||||
|
||||
- if (!ret)
|
||||
+ if (!ret) {
|
||||
/* error is already populated */
|
||||
+ g_free (args);
|
||||
return FALSE;
|
||||
+ }
|
||||
|
||||
args_str = g_strjoinv (" ", args ? (gchar **) args : (gchar **) argv);
|
||||
msg = g_strdup_printf ("Started '%s'", args_str);
|
||||
progress_id = bd_utils_report_started (msg);
|
||||
g_free (args_str);
|
||||
+ g_free (args);
|
||||
g_free (msg);
|
||||
|
||||
out_pipe = g_io_channel_unix_new (out_fd);
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From e943381bf7c1aeb27f6e308f95e3f64436f25247 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Thu, 9 May 2019 15:39:24 +0200
|
||||
Subject: [PATCH 05/17] mdraid: Fix g_strsplit() leaks
|
||||
|
||||
---
|
||||
src/plugins/mdraid.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
diff --git a/src/plugins/mdraid.c b/src/plugins/mdraid.c
|
||||
index 6465dfe..178379e 100644
|
||||
--- a/src/plugins/mdraid.c
|
||||
+++ b/src/plugins/mdraid.c
|
||||
@@ -255,10 +255,15 @@ static GHashTable* parse_mdadm_vars (const gchar *str, const gchar *item_sep, co
|
||||
/* mdadm --examine output for a set being migrated */
|
||||
vals = g_strsplit (key_val[1], "<--", 2);
|
||||
g_hash_table_insert (table, g_strstrip (key_val[0]), g_strstrip (vals[0]));
|
||||
+ g_free (key_val[1]);
|
||||
g_free (vals[1]);
|
||||
+ g_free (vals);
|
||||
} else {
|
||||
g_hash_table_insert (table, g_strstrip (key_val[0]), g_strstrip (key_val[1]));
|
||||
}
|
||||
+ g_free (key_val);
|
||||
+ } else {
|
||||
+ g_strfreev (key_val);
|
||||
}
|
||||
(*num_items)++;
|
||||
} else
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 21fba5737901b6fa82b3c04bb9058ac650b8e54d Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Thu, 9 May 2019 15:39:39 +0200
|
||||
Subject: [PATCH 06/17] s390: Fix g_strsplit() leaks
|
||||
|
||||
---
|
||||
src/plugins/s390.c | 8 ++------
|
||||
1 file changed, 2 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/s390.c b/src/plugins/s390.c
|
||||
index dcb5bc9..ac12b04 100644
|
||||
--- a/src/plugins/s390.c
|
||||
+++ b/src/plugins/s390.c
|
||||
@@ -775,8 +775,6 @@ gboolean bd_s390_zfcp_scsi_offline(const gchar *devno, const gchar *wwpn, const
|
||||
gchar *hba_path = NULL;
|
||||
gchar *wwpn_path = NULL;
|
||||
gchar *lun_path = NULL;
|
||||
- gchar *host = NULL;
|
||||
- gchar *fcplun = NULL;
|
||||
gchar *scsidev = NULL;
|
||||
gchar *fcpsysfs = NULL;
|
||||
gchar *scsidel = NULL;
|
||||
@@ -804,13 +802,11 @@ gboolean bd_s390_zfcp_scsi_offline(const gchar *devno, const gchar *wwpn, const
|
||||
/* tokenize line and assign certain values we'll need later */
|
||||
tokens = g_strsplit (line, delim, 8);
|
||||
|
||||
- host = tokens[1];
|
||||
- fcplun = tokens[7];
|
||||
-
|
||||
- scsidev = g_strdup_printf ("%s:%s:%s:%s", host + 4, channel, devid, fcplun);
|
||||
+ scsidev = g_strdup_printf ("%s:%s:%s:%s", tokens[1] /* host */ + 4, channel, devid, tokens[7] /* fcplun */);
|
||||
scsidev = g_strchomp (scsidev);
|
||||
fcpsysfs = g_strdup_printf ("%s/%s", scsidevsysfs, scsidev);
|
||||
fcpsysfs = g_strchomp (fcpsysfs);
|
||||
+ g_strfreev (tokens);
|
||||
|
||||
/* get HBA path value (same as device number) */
|
||||
hba_path = g_strdup_printf ("%s/hba_id", fcpsysfs);
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 9e751457a983a4ba07fcd285b15af29aad051b25 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Thu, 9 May 2019 16:10:11 +0200
|
||||
Subject: [PATCH 07/17] ext: Fix g_strsplit() leaks
|
||||
|
||||
---
|
||||
src/plugins/fs/ext.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/plugins/fs/ext.c b/src/plugins/fs/ext.c
|
||||
index 03ac1c5..98f2861 100644
|
||||
--- a/src/plugins/fs/ext.c
|
||||
+++ b/src/plugins/fs/ext.c
|
||||
@@ -534,6 +534,7 @@ static GHashTable* parse_output_vars (const gchar *str, const gchar *item_sep, c
|
||||
if (g_strv_length (key_val) == 2) {
|
||||
/* we only want to process valid lines (with the separator) */
|
||||
g_hash_table_insert (table, g_strstrip (key_val[0]), g_strstrip (key_val[1]));
|
||||
+ g_free (key_val);
|
||||
(*num_items)++;
|
||||
} else
|
||||
/* invalid line, just free key_val */
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From bb774818d210f7159ed0b7db11c1a8490ac7ee0f Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Thu, 9 May 2019 16:15:36 +0200
|
||||
Subject: [PATCH 08/17] ext: Fix g_match_info_fetch() leaks
|
||||
|
||||
---
|
||||
src/plugins/fs/ext.c | 16 +++++++++++++---
|
||||
1 file changed, 13 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/fs/ext.c b/src/plugins/fs/ext.c
|
||||
index 98f2861..91b0ff5 100644
|
||||
--- a/src/plugins/fs/ext.c
|
||||
+++ b/src/plugins/fs/ext.c
|
||||
@@ -96,13 +96,23 @@ static gint8 filter_line_fsck (const gchar * line, guint8 total_stages, GError *
|
||||
guint8 stage;
|
||||
gint64 val_cur;
|
||||
gint64 val_total;
|
||||
+ gchar *s;
|
||||
|
||||
/* The output_regex ensures we have a number in these matches, so we can skip
|
||||
* tests for conversion errors.
|
||||
*/
|
||||
- stage = (guint8) g_ascii_strtoull (g_match_info_fetch (match_info, 1), (char **)NULL, 10);
|
||||
- val_cur = g_ascii_strtoll (g_match_info_fetch (match_info, 2), (char **)NULL, 10);
|
||||
- val_total = g_ascii_strtoll (g_match_info_fetch (match_info, 3), (char **)NULL, 10);
|
||||
+ s = g_match_info_fetch (match_info, 1);
|
||||
+ stage = (guint8) g_ascii_strtoull (s, (char **)NULL, 10);
|
||||
+ g_free (s);
|
||||
+
|
||||
+ s = g_match_info_fetch (match_info, 2);
|
||||
+ val_cur = g_ascii_strtoll (s, (char **)NULL, 10);
|
||||
+ g_free (s);
|
||||
+
|
||||
+ s = g_match_info_fetch (match_info, 3);
|
||||
+ val_total = g_ascii_strtoll (s, (char **)NULL, 10);
|
||||
+ g_free (s);
|
||||
+
|
||||
perc = compute_percents (stage, total_stages, val_cur, val_total);
|
||||
} else {
|
||||
g_match_info_free (match_info);
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 70779be74507b5e8a3d4d6c5a226906186844f0b Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Thu, 9 May 2019 16:16:06 +0200
|
||||
Subject: [PATCH 09/17] kbd: Fix g_match_info_fetch() leaks
|
||||
|
||||
---
|
||||
src/plugins/kbd.c | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/plugins/kbd.c b/src/plugins/kbd.c
|
||||
index 33208c7..a2908ec 100644
|
||||
--- a/src/plugins/kbd.c
|
||||
+++ b/src/plugins/kbd.c
|
||||
@@ -782,7 +782,11 @@ gboolean bd_kbd_bcache_create (const gchar *backing_device, const gchar *cache_d
|
||||
for (i=0; lines[i] && n < 2; i++) {
|
||||
success = g_regex_match (regex, lines[i], 0, &match_info);
|
||||
if (success) {
|
||||
- strncpy (device_uuid[n], g_match_info_fetch (match_info, 1), 63);
|
||||
+ gchar *s;
|
||||
+
|
||||
+ s = g_match_info_fetch (match_info, 1);
|
||||
+ strncpy (device_uuid[n], s, 63);
|
||||
+ g_free (s);
|
||||
device_uuid[n][63] = '\0';
|
||||
n++;
|
||||
g_match_info_free (match_info);
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 9c364521d3a7b0b8c04061003f16d73eee8778c8 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Thu, 9 May 2019 17:16:37 +0200
|
||||
Subject: [PATCH 10/17] part: Fix leaking objects
|
||||
|
||||
---
|
||||
src/plugins/part.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
diff --git a/src/plugins/part.c b/src/plugins/part.c
|
||||
index 31c6591..cf62366 100644
|
||||
--- a/src/plugins/part.c
|
||||
+++ b/src/plugins/part.c
|
||||
@@ -913,6 +913,8 @@ static gboolean resize_part (PedPartition *part, PedDevice *dev, PedDisk *disk,
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
+ ped_geometry_destroy (geom);
|
||||
+ ped_constraint_destroy (constr);
|
||||
finish_alignment_constraint (disk, orig_flag_state);
|
||||
return TRUE;
|
||||
}
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 2d24ea310fe65b020d7ef3450057bde1383910aa Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Thu, 9 May 2019 17:17:01 +0200
|
||||
Subject: [PATCH 11/17] ext: Fix leaking string
|
||||
|
||||
---
|
||||
src/plugins/fs/ext.c | 4 +++-
|
||||
1 file changed, 3 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/plugins/fs/ext.c b/src/plugins/fs/ext.c
|
||||
index 91b0ff5..fbec90a 100644
|
||||
--- a/src/plugins/fs/ext.c
|
||||
+++ b/src/plugins/fs/ext.c
|
||||
@@ -560,8 +560,10 @@ static BDFSExtInfo* get_ext_info_from_table (GHashTable *table, gboolean free_ta
|
||||
gchar *value = NULL;
|
||||
|
||||
ret->label = g_strdup ((gchar*) g_hash_table_lookup (table, "Filesystem volume name"));
|
||||
- if ((!ret->label) || (g_strcmp0 (ret->label, "<none>") == 0))
|
||||
+ if (!ret->label || g_strcmp0 (ret->label, "<none>") == 0) {
|
||||
+ g_free (ret->label);
|
||||
ret->label = g_strdup ("");
|
||||
+ }
|
||||
ret->uuid = g_strdup ((gchar*) g_hash_table_lookup (table, "Filesystem UUID"));
|
||||
ret->state = g_strdup ((gchar*) g_hash_table_lookup (table, "Filesystem state"));
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 957b4b84eeaacab612ea5e267dc37b194f9d65f3 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Thu, 9 May 2019 18:23:46 +0200
|
||||
Subject: [PATCH 12/17] part: Fix leaking string in args
|
||||
|
||||
---
|
||||
src/plugins/part.c | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/part.c b/src/plugins/part.c
|
||||
index cf62366..8b2285f 100644
|
||||
--- a/src/plugins/part.c
|
||||
+++ b/src/plugins/part.c
|
||||
@@ -373,10 +373,9 @@ static gchar* get_part_type_guid_and_gpt_flags (const gchar *device, int part_nu
|
||||
|
||||
args[1] = g_strdup_printf ("-i%d", part_num);
|
||||
success = bd_utils_exec_and_capture_output (args, NULL, &output, error);
|
||||
- if (!success) {
|
||||
- g_free ((gchar *) args[1]);
|
||||
+ g_free ((gchar *) args[1]);
|
||||
+ if (!success)
|
||||
return FALSE;
|
||||
- }
|
||||
|
||||
lines = g_strsplit (output, "\n", 0);
|
||||
g_free (output);
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 6613cc6b28766607801f95b54bcbc872de02412b Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Thu, 16 May 2019 12:46:56 +0200
|
||||
Subject: [PATCH 13/17] mdraid: Fix leaking error
|
||||
|
||||
---
|
||||
src/plugins/mdraid.c | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/mdraid.c b/src/plugins/mdraid.c
|
||||
index 178379e..8f5b2ca 100644
|
||||
--- a/src/plugins/mdraid.c
|
||||
+++ b/src/plugins/mdraid.c
|
||||
@@ -178,7 +178,7 @@ gboolean bd_md_check_deps (void) {
|
||||
}
|
||||
|
||||
if (!ret)
|
||||
- g_warning("Cannot load the MDRAID plugin");
|
||||
+ g_warning ("Cannot load the MDRAID plugin");
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -357,8 +357,7 @@ static BDMDExamineData* get_examine_data_from_table (GHashTable *table, gboolean
|
||||
}
|
||||
|
||||
if (bs_error) {
|
||||
- g_set_error (error, BD_MD_ERROR, BD_MD_ERROR_PARSE,
|
||||
- "Failed to parse chunk size from mdexamine data: %s", bs_error->msg);
|
||||
+ g_warning ("get_examine_data_from_table(): Failed to parse chunk size from mdexamine data: %s", bs_error->msg);
|
||||
bs_clear_error (&bs_error);
|
||||
}
|
||||
} else
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 9ad488f460f65abded312be4b5cf1f00f9fc8aa5 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Thu, 16 May 2019 12:54:09 +0200
|
||||
Subject: [PATCH 14/17] mdraid: Mark 'error' arg in
|
||||
get_examine_data_from_table() as unused
|
||||
|
||||
---
|
||||
src/plugins/mdraid.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/plugins/mdraid.c b/src/plugins/mdraid.c
|
||||
index 8f5b2ca..a333e6f 100644
|
||||
--- a/src/plugins/mdraid.c
|
||||
+++ b/src/plugins/mdraid.c
|
||||
@@ -275,7 +275,7 @@ static GHashTable* parse_mdadm_vars (const gchar *str, const gchar *item_sep, co
|
||||
return table;
|
||||
}
|
||||
|
||||
-static BDMDExamineData* get_examine_data_from_table (GHashTable *table, gboolean free_table, GError **error) {
|
||||
+static BDMDExamineData* get_examine_data_from_table (GHashTable *table, gboolean free_table, G_GNUC_UNUSED GError **error) {
|
||||
BDMDExamineData *data = g_new0 (BDMDExamineData, 1);
|
||||
gchar *value = NULL;
|
||||
gchar *first_space = NULL;
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From eaa07958b928141783202967cbae0e86fdee488d Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Thu, 16 May 2019 12:55:50 +0200
|
||||
Subject: [PATCH 15/17] mdraid: Fix leaking BDMDExamineData.metadata
|
||||
|
||||
---
|
||||
src/plugins/mdraid.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/src/plugins/mdraid.c b/src/plugins/mdraid.c
|
||||
index a333e6f..74af744 100644
|
||||
--- a/src/plugins/mdraid.c
|
||||
+++ b/src/plugins/mdraid.c
|
||||
@@ -1049,6 +1049,7 @@ BDMDExamineData* bd_md_examine (const gchar *device, GError **error) {
|
||||
}
|
||||
|
||||
/* try to get metadata version from the output (may be missing) */
|
||||
+ g_free (ret->metadata);
|
||||
value = (gchar*) g_hash_table_lookup (table, "metadata");
|
||||
if (value)
|
||||
ret->metadata = g_strdup (value);
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 6b384841027c22f3fac28dd295e8a6124d4d7498 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Thu, 16 May 2019 17:40:51 +0200
|
||||
Subject: [PATCH 16/17] btrfs: Fix number of memory leaks
|
||||
|
||||
---
|
||||
src/plugins/btrfs.c | 40 ++++++++++++++++++++++------------------
|
||||
1 file changed, 22 insertions(+), 18 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/btrfs.c b/src/plugins/btrfs.c
|
||||
index c76ea3f..8a2c81a 100644
|
||||
--- a/src/plugins/btrfs.c
|
||||
+++ b/src/plugins/btrfs.c
|
||||
@@ -619,9 +619,7 @@ BDBtrfsDeviceInfo** bd_btrfs_list_devices (const gchar *device, GError **error)
|
||||
"path[ \\t]+(?P<path>\\S+)\n";
|
||||
GRegex *regex = NULL;
|
||||
GMatchInfo *match_info = NULL;
|
||||
- guint8 i = 0;
|
||||
- GPtrArray *dev_infos = g_ptr_array_new ();
|
||||
- BDBtrfsDeviceInfo** ret = NULL;
|
||||
+ GPtrArray *dev_infos;
|
||||
|
||||
if (!check_deps (&avail_deps, DEPS_BTRFS_MASK, deps, DEPS_LAST, &deps_check_lock, error) ||
|
||||
!check_module_deps (&avail_module_deps, MODULE_DEPS_BTRFS_MASK, module_deps, MODULE_DEPS_LAST, &deps_check_lock, error))
|
||||
@@ -635,13 +633,16 @@ BDBtrfsDeviceInfo** bd_btrfs_list_devices (const gchar *device, GError **error)
|
||||
}
|
||||
|
||||
success = bd_utils_exec_and_capture_output (argv, NULL, &output, error);
|
||||
- if (!success)
|
||||
+ if (!success) {
|
||||
+ g_regex_unref (regex);
|
||||
/* error is already populated from the previous call */
|
||||
return NULL;
|
||||
+ }
|
||||
|
||||
lines = g_strsplit (output, "\n", 0);
|
||||
g_free (output);
|
||||
|
||||
+ dev_infos = g_ptr_array_new ();
|
||||
for (line_p = lines; *line_p; line_p++) {
|
||||
success = g_regex_match (regex, *line_p, 0, &match_info);
|
||||
if (!success) {
|
||||
@@ -654,21 +655,16 @@ BDBtrfsDeviceInfo** bd_btrfs_list_devices (const gchar *device, GError **error)
|
||||
}
|
||||
|
||||
g_strfreev (lines);
|
||||
+ g_regex_unref (regex);
|
||||
|
||||
if (dev_infos->len == 0) {
|
||||
g_set_error (error, BD_BTRFS_ERROR, BD_BTRFS_ERROR_PARSE, "Failed to parse information about devices");
|
||||
+ g_ptr_array_free (dev_infos, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- /* now create the return value -- NULL-terminated array of BDBtrfsDeviceInfo */
|
||||
- ret = g_new0 (BDBtrfsDeviceInfo*, dev_infos->len + 1);
|
||||
- for (i=0; i < dev_infos->len; i++)
|
||||
- ret[i] = (BDBtrfsDeviceInfo*) g_ptr_array_index (dev_infos, i);
|
||||
- ret[i] = NULL;
|
||||
-
|
||||
- g_ptr_array_free (dev_infos, FALSE);
|
||||
-
|
||||
- return ret;
|
||||
+ g_ptr_array_add (dev_infos, NULL);
|
||||
+ return (BDBtrfsDeviceInfo **) g_ptr_array_free (dev_infos, FALSE);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -700,7 +696,7 @@ BDBtrfsSubvolumeInfo** bd_btrfs_list_subvolumes (const gchar *mountpoint, gboole
|
||||
guint64 i = 0;
|
||||
guint64 y = 0;
|
||||
guint64 next_sorted_idx = 0;
|
||||
- GPtrArray *subvol_infos = g_ptr_array_new ();
|
||||
+ GPtrArray *subvol_infos;
|
||||
BDBtrfsSubvolumeInfo* item = NULL;
|
||||
BDBtrfsSubvolumeInfo* swap_item = NULL;
|
||||
BDBtrfsSubvolumeInfo** ret = NULL;
|
||||
@@ -724,11 +720,11 @@ BDBtrfsSubvolumeInfo** bd_btrfs_list_subvolumes (const gchar *mountpoint, gboole
|
||||
|
||||
success = bd_utils_exec_and_capture_output (argv, NULL, &output, error);
|
||||
if (!success) {
|
||||
+ g_regex_unref (regex);
|
||||
if (g_error_matches (*error, BD_UTILS_EXEC_ERROR, BD_UTILS_EXEC_ERROR_NOOUT)) {
|
||||
/* no output -> no subvolumes */
|
||||
- ret = g_new0 (BDBtrfsSubvolumeInfo*, 1);
|
||||
g_clear_error (error);
|
||||
- return ret;
|
||||
+ return g_new0 (BDBtrfsSubvolumeInfo*, 1);
|
||||
} else {
|
||||
/* error is already populated from the call above or simply no output*/
|
||||
return NULL;
|
||||
@@ -738,6 +734,7 @@ BDBtrfsSubvolumeInfo** bd_btrfs_list_subvolumes (const gchar *mountpoint, gboole
|
||||
lines = g_strsplit (output, "\n", 0);
|
||||
g_free (output);
|
||||
|
||||
+ subvol_infos = g_ptr_array_new ();
|
||||
for (line_p = lines; *line_p; line_p++) {
|
||||
success = g_regex_match (regex, *line_p, 0, &match_info);
|
||||
if (!success) {
|
||||
@@ -750,9 +747,11 @@ BDBtrfsSubvolumeInfo** bd_btrfs_list_subvolumes (const gchar *mountpoint, gboole
|
||||
}
|
||||
|
||||
g_strfreev (lines);
|
||||
+ g_regex_unref (regex);
|
||||
|
||||
if (subvol_infos->len == 0) {
|
||||
g_set_error (error, BD_BTRFS_ERROR, BD_BTRFS_ERROR_PARSE, "Failed to parse information about subvolumes");
|
||||
+ g_ptr_array_free (subvol_infos, TRUE);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -828,21 +827,26 @@ BDBtrfsFilesystemInfo* bd_btrfs_filesystem_info (const gchar *device, GError **e
|
||||
}
|
||||
|
||||
success = bd_utils_exec_and_capture_output (argv, NULL, &output, error);
|
||||
- if (!success)
|
||||
+ if (!success) {
|
||||
/* error is already populated from the call above or just empty
|
||||
output */
|
||||
+ g_regex_unref (regex);
|
||||
return NULL;
|
||||
+ }
|
||||
|
||||
success = g_regex_match (regex, output, 0, &match_info);
|
||||
if (!success) {
|
||||
g_regex_unref (regex);
|
||||
g_match_info_free (match_info);
|
||||
+ g_free (output);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- g_regex_unref (regex);
|
||||
ret = get_filesystem_info_from_match (match_info);
|
||||
g_match_info_free (match_info);
|
||||
+ g_regex_unref (regex);
|
||||
+
|
||||
+ g_free (output);
|
||||
|
||||
return ret;
|
||||
}
|
||||
--
|
||||
2.21.0
|
||||
|
||||
|
||||
From 6f0ec1d90584c59da9bb5f22f692b7d5ebfb2708 Mon Sep 17 00:00:00 2001
|
||||
From: Tomas Bzatek <tbzatek@redhat.com>
|
||||
Date: Fri, 17 May 2019 16:09:50 +0200
|
||||
Subject: [PATCH 17/17] module: Fix libkmod related leak
|
||||
|
||||
---
|
||||
src/utils/module.c | 7 ++++---
|
||||
1 file changed, 4 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/utils/module.c b/src/utils/module.c
|
||||
index 0709633..cdad960 100644
|
||||
--- a/src/utils/module.c
|
||||
+++ b/src/utils/module.c
|
||||
@@ -60,7 +60,7 @@ gboolean bd_utils_have_kernel_module (const gchar *module_name, GError **error)
|
||||
return FALSE;
|
||||
}
|
||||
/* prevent libkmod from spamming our STDERR */
|
||||
- kmod_set_log_priority(ctx, LOG_CRIT);
|
||||
+ kmod_set_log_priority (ctx, LOG_CRIT);
|
||||
|
||||
ret = kmod_module_new_from_name (ctx, module_name, &mod);
|
||||
if (ret < 0) {
|
||||
@@ -106,7 +106,7 @@ gboolean bd_utils_load_kernel_module (const gchar *module_name, const gchar *opt
|
||||
return FALSE;
|
||||
}
|
||||
/* prevent libkmod from spamming our STDERR */
|
||||
- kmod_set_log_priority(ctx, LOG_CRIT);
|
||||
+ kmod_set_log_priority (ctx, LOG_CRIT);
|
||||
|
||||
ret = kmod_module_new_from_name (ctx, module_name, &mod);
|
||||
if (ret < 0) {
|
||||
@@ -169,7 +169,7 @@ gboolean bd_utils_unload_kernel_module (const gchar *module_name, GError **error
|
||||
return FALSE;
|
||||
}
|
||||
/* prevent libkmod from spamming our STDERR */
|
||||
- kmod_set_log_priority(ctx, LOG_CRIT);
|
||||
+ kmod_set_log_priority (ctx, LOG_CRIT);
|
||||
|
||||
ret = kmod_module_new_from_loaded (ctx, &list);
|
||||
if (ret < 0) {
|
||||
@@ -187,6 +187,7 @@ gboolean bd_utils_unload_kernel_module (const gchar *module_name, GError **error
|
||||
else
|
||||
kmod_module_unref (mod);
|
||||
}
|
||||
+ kmod_module_unref_list (list);
|
||||
|
||||
if (!found) {
|
||||
g_set_error (error, BD_UTILS_MODULE_ERROR, BD_UTILS_MODULE_ERROR_NOEXIST,
|
||||
--
|
||||
2.21.0
|
||||
|
||||
@ -1,299 +0,0 @@
|
||||
From 5e8429d004445c6f6e6f16cab67cf14cb4d32a65 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Tue, 18 Apr 2023 12:05:35 +0200
|
||||
Subject: [PATCH] lvm: Add support for starting and stopping VG locking
|
||||
|
||||
---
|
||||
docs/libblockdev-sections.txt | 2 ++
|
||||
src/lib/plugin_apis/lvm.api | 27 +++++++++++++++++++
|
||||
src/plugins/lvm-dbus.c | 49 ++++++++++++++++++++++++++++++++++-
|
||||
src/plugins/lvm.c | 41 +++++++++++++++++++++++++++++
|
||||
src/plugins/lvm.h | 3 +++
|
||||
tests/lvm_dbus_tests.py | 33 +++++++++++++++++++++++
|
||||
tests/lvm_test.py | 32 +++++++++++++++++++++++
|
||||
7 files changed, 186 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/docs/libblockdev-sections.txt b/docs/libblockdev-sections.txt
|
||||
index 512820c2..7377dd17 100644
|
||||
--- a/docs/libblockdev-sections.txt
|
||||
+++ b/docs/libblockdev-sections.txt
|
||||
@@ -286,6 +286,8 @@ bd_lvm_vgactivate
|
||||
bd_lvm_vgdeactivate
|
||||
bd_lvm_vgextend
|
||||
bd_lvm_vgreduce
|
||||
+bd_lvm_vglock_start
|
||||
+bd_lvm_vglock_stop
|
||||
bd_lvm_vginfo
|
||||
bd_lvm_vgs
|
||||
bd_lvm_lvorigin
|
||||
diff --git a/src/lib/plugin_apis/lvm.api b/src/lib/plugin_apis/lvm.api
|
||||
index 54c47a93..14f2620a 100644
|
||||
--- a/src/lib/plugin_apis/lvm.api
|
||||
+++ b/src/lib/plugin_apis/lvm.api
|
||||
@@ -601,6 +601,7 @@ typedef enum {
|
||||
BD_LVM_TECH_CACHE_CALCS,
|
||||
BD_LVM_TECH_GLOB_CONF,
|
||||
BD_LVM_TECH_VDO,
|
||||
+ BD_LVM_TECH_SHARED,
|
||||
} BDLVMTech;
|
||||
|
||||
typedef enum {
|
||||
@@ -941,6 +942,32 @@ gboolean bd_lvm_vgextend (const gchar *vg_name, const gchar *device, const BDExt
|
||||
*/
|
||||
gboolean bd_lvm_vgreduce (const gchar *vg_name, const gchar *device, const BDExtraArg **extra, GError **error);
|
||||
|
||||
+/**
|
||||
+ * bd_lvm_vglock_start:
|
||||
+ * @vg_name: a shared VG to start the lockspace in lvmlockd
|
||||
+ * @extra: (nullable) (array zero-terminated=1): extra options for the vgchange command
|
||||
+ * (just passed to LVM as is)
|
||||
+ * @error: (out): place to store error (if any)
|
||||
+ *
|
||||
+ * Returns: whether the lock was successfully started for @vg_name or not
|
||||
+ *
|
||||
+ * Tech category: %BD_LVM_TECH_SHARED-%BD_LVM_TECH_MODE_MODIFY
|
||||
+ */
|
||||
+gboolean bd_lvm_vglock_start (const gchar *vg_name, const BDExtraArg **extra, GError **error);
|
||||
+
|
||||
+/**
|
||||
+ * bd_lvm_vglock_stop:
|
||||
+ * @vg_name: a shared VG to stop the lockspace in lvmlockd
|
||||
+ * @extra: (nullable) (array zero-terminated=1): extra options for the vgchange command
|
||||
+ * (just passed to LVM as is)
|
||||
+ * @error: (out): place to store error (if any)
|
||||
+ *
|
||||
+ * Returns: whether the lock was successfully stopped for @vg_name or not
|
||||
+ *
|
||||
+ * Tech category: %BD_LVM_TECH_SHARED-%BD_LVM_TECH_MODE_MODIFY
|
||||
+ */
|
||||
+gboolean bd_lvm_vglock_stop (const gchar *vg_name, const BDExtraArg **extra, GError **error);
|
||||
+
|
||||
/**
|
||||
* bd_lvm_vginfo:
|
||||
* @vg_name: a VG to get information about
|
||||
diff --git a/src/plugins/lvm-dbus.c b/src/plugins/lvm-dbus.c
|
||||
index e1f946fe..ad44dfb3 100644
|
||||
--- a/src/plugins/lvm-dbus.c
|
||||
+++ b/src/plugins/lvm-dbus.c
|
||||
@@ -1848,10 +1848,57 @@ gboolean bd_lvm_vgreduce (const gchar *vg_name, const gchar *device, const BDExt
|
||||
return ((*error) == NULL);
|
||||
}
|
||||
|
||||
+gboolean _vglock_start_stop (const gchar *vg_name, gboolean start, const BDExtraArg **extra, GError **error) {
|
||||
+ GVariantBuilder builder;
|
||||
+ GVariant *params = NULL;
|
||||
+
|
||||
+ g_variant_builder_init (&builder, G_VARIANT_TYPE_DICTIONARY);
|
||||
+ if (start)
|
||||
+ g_variant_builder_add (&builder, "{sv}", "--lockstart", g_variant_new ("s", ""));
|
||||
+ else
|
||||
+ g_variant_builder_add (&builder, "{sv}", "--lockstop", g_variant_new ("s", ""));
|
||||
+ params = g_variant_builder_end (&builder);
|
||||
+ g_variant_builder_clear (&builder);
|
||||
+
|
||||
+ call_lvm_obj_method_sync (vg_name, VG_INTF, "Change", NULL, params, extra, TRUE, error);
|
||||
+
|
||||
+ return ((*error) == NULL);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * bd_lvm_vglock_start:
|
||||
+ * @vg_name: a shared VG to start the lockspace in lvmlockd
|
||||
+ * @extra: (nullable) (array zero-terminated=1): extra options for the vgchange command
|
||||
+ * (just passed to LVM as is)
|
||||
+ * @error: (out): place to store error (if any)
|
||||
+ *
|
||||
+ * Returns: whether the lock was successfully started for @vg_name or not
|
||||
+ *
|
||||
+ * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
|
||||
+ */
|
||||
+gboolean bd_lvm_vglock_start (const gchar *vg_name, const BDExtraArg **extra, GError **error) {
|
||||
+ return _vglock_start_stop (vg_name, TRUE, extra, error);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * bd_lvm_vglock_stop:
|
||||
+ * @vg_name: a shared VG to stop the lockspace in lvmlockd
|
||||
+ * @extra: (nullable) (array zero-terminated=1): extra options for the vgchange command
|
||||
+ * (just passed to LVM as is)
|
||||
+ * @error: (out): place to store error (if any)
|
||||
+ *
|
||||
+ * Returns: whether the lock was successfully stopped for @vg_name or not
|
||||
+ *
|
||||
+ * Tech category: %BD_LVM_TECH_BASIC-%BD_LVM_TECH_MODE_MODIFY
|
||||
+ */
|
||||
+gboolean bd_lvm_vglock_stop (const gchar *vg_name, const BDExtraArg **extra, GError **error) {
|
||||
+ return _vglock_start_stop (vg_name, FALSE, extra, error);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* bd_lvm_vginfo:
|
||||
* @vg_name: a VG to get information about
|
||||
- * @error: (out): place to store error (if any)
|
||||
+ * @error: (out) (optional): place to store error (if any)
|
||||
*
|
||||
* Returns: (transfer full): information about the @vg_name VG or %NULL in case
|
||||
* of error (the @error) gets populated in those cases)
|
||||
diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c
|
||||
index 8bb3ae24..1aaf6747 100644
|
||||
--- a/src/plugins/lvm.c
|
||||
+++ b/src/plugins/lvm.c
|
||||
@@ -1316,6 +1316,47 @@ gboolean bd_lvm_vgreduce (const gchar *vg_name, const gchar *device, const BDExt
|
||||
return call_lvm_and_report_error (args, extra, TRUE, error);
|
||||
}
|
||||
|
||||
+gboolean _vglock_start_stop (const gchar *vg_name, gboolean start, const BDExtraArg **extra, GError **error) {
|
||||
+ const gchar *args[4] = {"vgchange", NULL, vg_name, NULL};
|
||||
+
|
||||
+ if (start)
|
||||
+ args[1] = "--lockstart";
|
||||
+ else
|
||||
+ args[1] = "--lockstop";
|
||||
+
|
||||
+ return call_lvm_and_report_error (args, extra, TRUE, error);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * bd_lvm_vglock_start:
|
||||
+ * @vg_name: a shared VG to start the lockspace in lvmlockd
|
||||
+ * @extra: (nullable) (array zero-terminated=1): extra options for the vgchange command
|
||||
+ * (just passed to LVM as is)
|
||||
+ * @error: (out): place to store error (if any)
|
||||
+ *
|
||||
+ * Returns: whether the lock was successfully started for @vg_name or not
|
||||
+ *
|
||||
+ * Tech category: %BD_LVM_TECH_SHARED-%BD_LVM_TECH_MODE_MODIFY
|
||||
+ */
|
||||
+gboolean bd_lvm_vglock_start (const gchar *vg_name, const BDExtraArg **extra, GError **error) {
|
||||
+ return _vglock_start_stop (vg_name, TRUE, extra, error);
|
||||
+}
|
||||
+
|
||||
+/**
|
||||
+ * bd_lvm_vglock_stop:
|
||||
+ * @vg_name: a shared VG to stop the lockspace in lvmlockd
|
||||
+ * @extra: (nullable) (array zero-terminated=1): extra options for the vgchange command
|
||||
+ * (just passed to LVM as is)
|
||||
+ * @error: (out): place to store error (if any)
|
||||
+ *
|
||||
+ * Returns: whether the lock was successfully stopped for @vg_name or not
|
||||
+ *
|
||||
+ * Tech category: %BD_LVM_TECH_SHARED-%BD_LVM_TECH_MODE_MODIFY
|
||||
+ */
|
||||
+gboolean bd_lvm_vglock_stop (const gchar *vg_name, const BDExtraArg **extra, GError **error) {
|
||||
+ return _vglock_start_stop (vg_name, FALSE, extra, error);
|
||||
+}
|
||||
+
|
||||
/**
|
||||
* bd_lvm_vginfo:
|
||||
* @vg_name: a VG to get information about
|
||||
diff --git a/src/plugins/lvm.h b/src/plugins/lvm.h
|
||||
index 244663a4..da14cc1a 100644
|
||||
--- a/src/plugins/lvm.h
|
||||
+++ b/src/plugins/lvm.h
|
||||
@@ -216,6 +216,7 @@ typedef enum {
|
||||
BD_LVM_TECH_CACHE_CALCS,
|
||||
BD_LVM_TECH_GLOB_CONF,
|
||||
BD_LVM_TECH_VDO,
|
||||
+ BD_LVM_TECH_SHARED,
|
||||
} BDLVMTech;
|
||||
|
||||
typedef enum {
|
||||
@@ -266,6 +267,8 @@ gboolean bd_lvm_vgactivate (const gchar *vg_name, const BDExtraArg **extra, GErr
|
||||
gboolean bd_lvm_vgdeactivate (const gchar *vg_name, const BDExtraArg **extra, GError **error);
|
||||
gboolean bd_lvm_vgextend (const gchar *vg_name, const gchar *device, const BDExtraArg **extra, GError **error);
|
||||
gboolean bd_lvm_vgreduce (const gchar *vg_name, const gchar *device, const BDExtraArg **extra, GError **error);
|
||||
+gboolean bd_lvm_vglock_start (const gchar *vg_name, const BDExtraArg **extra, GError **error);
|
||||
+gboolean bd_lvm_vglock_stop (const gchar *vg_name, const BDExtraArg **extra, GError **error);
|
||||
BDLVMVGdata* bd_lvm_vginfo (const gchar *vg_name, GError **error);
|
||||
BDLVMVGdata** bd_lvm_vgs (GError **error);
|
||||
|
||||
diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py
|
||||
index 862a44cf..2a92c7c1 100644
|
||||
--- a/tests/lvm_dbus_tests.py
|
||||
+++ b/tests/lvm_dbus_tests.py
|
||||
@@ -612,6 +612,39 @@ class LvmTestVGs(LvmPVVGTestCase):
|
||||
succ = BlockDev.lvm_pvremove(self.loop_dev, None)
|
||||
self.assertTrue(succ)
|
||||
|
||||
+@unittest.skipUnless(lvm_dbus_running, "LVM DBus not running")
|
||||
+class LvmTestVGLocking(LvmPVVGTestCase):
|
||||
+ @tag_test(TestTags.UNSAFE)
|
||||
+ def test_vglock_stop_start(self):
|
||||
+ """Verify that it is possible to start and stop locking on a VG"""
|
||||
+
|
||||
+ # better not do anything if lvmlockd is running, shared VGs have
|
||||
+ # a tendency to wreak havoc on your system if you look at them wrong
|
||||
+ ret, _out, _err = run_command("systemctl is-active lvmlockd")
|
||||
+ if ret == 0:
|
||||
+ self.skipTest("lvmlockd is running, skipping")
|
||||
+
|
||||
+ _ret, out, _err = run_command("lvm config 'global/use_lvmlockd'")
|
||||
+ if "use_lvmlockd=0" not in out:
|
||||
+ self.skipTest("lvmlockd is enabled, skipping")
|
||||
+
|
||||
+ succ = BlockDev.lvm_pvcreate(self.loop_dev, 0, 0, None)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ succ = BlockDev.lvm_pvcreate(self.loop_dev2, 0, 0, None)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ succ = BlockDev.lvm_vgcreate("testVG", [self.loop_dev, self.loop_dev2], 0, None)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ # this actually doesn't "test" anything, the commands will just say lvmlockd is not
|
||||
+ # running and return 0, but that's good enough for us
|
||||
+ succ = BlockDev.lvm_vglock_start("testVG")
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ succ = BlockDev.lvm_vglock_stop("testVG")
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
@unittest.skipUnless(lvm_dbus_running, "LVM DBus not running")
|
||||
class LvmPVVGLVTestCase(LvmPVVGTestCase):
|
||||
def _clean_up(self):
|
||||
diff --git a/tests/lvm_test.py b/tests/lvm_test.py
|
||||
index 96f1670d..3ab11f04 100644
|
||||
--- a/tests/lvm_test.py
|
||||
+++ b/tests/lvm_test.py
|
||||
@@ -585,6 +585,38 @@ class LvmTestVGs(LvmPVVGTestCase):
|
||||
succ = BlockDev.lvm_pvremove(self.loop_dev, None)
|
||||
self.assertTrue(succ)
|
||||
|
||||
+class LvmTestVGLocking(LvmPVVGTestCase):
|
||||
+ @tag_test(TestTags.UNSAFE)
|
||||
+ def test_vglock_stop_start(self):
|
||||
+ """Verify that it is possible to start and stop locking on a VG"""
|
||||
+
|
||||
+ # better not do anything if lvmlockd is running, shared VGs have
|
||||
+ # a tendency to wreak havoc on your system if you look at them wrong
|
||||
+ ret, _out, _err = run_command("systemctl is-active lvmlockd")
|
||||
+ if ret == 0:
|
||||
+ self.skipTest("lvmlockd is running, skipping")
|
||||
+
|
||||
+ _ret, out, _err = run_command("lvm config 'global/use_lvmlockd'")
|
||||
+ if "use_lvmlockd=0" not in out:
|
||||
+ self.skipTest("lvmlockd is enabled, skipping")
|
||||
+
|
||||
+ succ = BlockDev.lvm_pvcreate(self.loop_dev, 0, 0, None)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ succ = BlockDev.lvm_pvcreate(self.loop_dev2, 0, 0, None)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ succ = BlockDev.lvm_vgcreate("testVG", [self.loop_dev, self.loop_dev2], 0, None)
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ # this actually doesn't "test" anything, the commands will just say lvmlockd is not
|
||||
+ # running and return 0, but that's good enough for us
|
||||
+ succ = BlockDev.lvm_vglock_start("testVG")
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
+ succ = BlockDev.lvm_vglock_stop("testVG")
|
||||
+ self.assertTrue(succ)
|
||||
+
|
||||
class LvmPVVGLVTestCase(LvmPVVGTestCase):
|
||||
def _clean_up(self):
|
||||
try:
|
||||
--
|
||||
2.41.0
|
||||
|
||||
66
SOURCES/0005-swap-status-on-dm.patch
Normal file
66
SOURCES/0005-swap-status-on-dm.patch
Normal file
@ -0,0 +1,66 @@
|
||||
From 3d75598da3fda5344934fe9cd86297856f340909 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Tue, 12 Feb 2019 12:21:03 +0100
|
||||
Subject: [PATCH] Fix checking swap status on lvm/md
|
||||
|
||||
'bd_utils_resolve_device' returns already resolved part, there is
|
||||
no '../' to remove.
|
||||
|
||||
Resolves: rhbz#1649815
|
||||
---
|
||||
src/plugins/swap.c | 11 ++---------
|
||||
1 file changed, 2 insertions(+), 9 deletions(-)
|
||||
|
||||
diff --git a/src/plugins/swap.c b/src/plugins/swap.c
|
||||
index 28db6f3..c8cdb57 100644
|
||||
--- a/src/plugins/swap.c
|
||||
+++ b/src/plugins/swap.c
|
||||
@@ -400,7 +400,6 @@ gboolean bd_swap_swapoff (const gchar *device, GError **error) {
|
||||
gboolean bd_swap_swapstatus (const gchar *device, GError **error) {
|
||||
gchar *file_content;
|
||||
gchar *real_device = NULL;
|
||||
- gchar *dev_path = NULL;
|
||||
gsize length;
|
||||
gchar *next_line;
|
||||
gboolean success;
|
||||
@@ -414,19 +413,15 @@ gboolean bd_swap_swapstatus (const gchar *device, GError **error) {
|
||||
/* get the real device node for device-mapper devices since the ones
|
||||
with meaningful names are just dev_paths */
|
||||
if (g_str_has_prefix (device, "/dev/mapper/") || g_str_has_prefix (device, "/dev/md/")) {
|
||||
- dev_path = bd_utils_resolve_device (device, error);
|
||||
- if (!dev_path) {
|
||||
+ real_device = bd_utils_resolve_device (device, error);
|
||||
+ if (!real_device) {
|
||||
/* the device doesn't exist and thus is not an active swap */
|
||||
g_clear_error (error);
|
||||
return FALSE;
|
||||
}
|
||||
-
|
||||
- /* the dev_path starts with "../" */
|
||||
- real_device = g_strdup_printf ("/dev/%s", dev_path + 3);
|
||||
}
|
||||
|
||||
if (g_str_has_prefix (file_content, real_device ? real_device : device)) {
|
||||
- g_free (dev_path);
|
||||
g_free (real_device);
|
||||
g_free (file_content);
|
||||
return TRUE;
|
||||
@@ -435,7 +430,6 @@ gboolean bd_swap_swapstatus (const gchar *device, GError **error) {
|
||||
next_line = (strchr (file_content, '\n') + 1);
|
||||
while (next_line && ((gsize)(next_line - file_content) < length)) {
|
||||
if (g_str_has_prefix (next_line, real_device ? real_device : device)) {
|
||||
- g_free (dev_path);
|
||||
g_free (real_device);
|
||||
g_free (file_content);
|
||||
return TRUE;
|
||||
@@ -444,7 +438,6 @@ gboolean bd_swap_swapstatus (const gchar *device, GError **error) {
|
||||
next_line = (strchr (next_line, '\n') + 1);
|
||||
}
|
||||
|
||||
- g_free (dev_path);
|
||||
g_free (real_device);
|
||||
g_free (file_content);
|
||||
return FALSE;
|
||||
--
|
||||
2.20.1
|
||||
|
||||
@ -1,26 +0,0 @@
|
||||
From 2508f4842482b87d26f81afecc7d0b584d6a6fa8 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Blume <Thomas.Blume@suse.com>
|
||||
Date: Fri, 16 May 2025 14:27:10 +0200
|
||||
Subject: [PATCH] Don't allow suid and dev set on fs resize
|
||||
|
||||
Fixes: CVE-2025-6019
|
||||
---
|
||||
src/plugins/fs/generic.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/src/plugins/fs/generic.c b/src/plugins/fs/generic.c
|
||||
index ca08d19a..15b55271 100644
|
||||
--- a/src/plugins/fs/generic.c
|
||||
+++ b/src/plugins/fs/generic.c
|
||||
@@ -409,7 +409,7 @@ static gboolean xfs_resize_device (const gchar *device, guint64 new_size, const
|
||||
"before resizing it.", device);
|
||||
return FALSE;
|
||||
}
|
||||
- ret = bd_fs_mount (device, mountpoint, "xfs", NULL, NULL, error);
|
||||
+ ret = bd_fs_mount (device, mountpoint, "xfs", "nosuid,nodev", NULL, error);
|
||||
if (!ret) {
|
||||
g_prefix_error (error, "Failed to mount '%s' before resizing it: ", device);
|
||||
return FALSE;
|
||||
--
|
||||
2.49.0
|
||||
|
||||
31
SOURCES/0006-use-cryptsetup-to-check-LUKS2-label.patch
Normal file
31
SOURCES/0006-use-cryptsetup-to-check-LUKS2-label.patch
Normal file
@ -0,0 +1,31 @@
|
||||
From d6c4429bbb09fae249d7b97b06a9346cdc99f962 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Wed, 19 Dec 2018 09:36:30 +0100
|
||||
Subject: [PATCH] Use cryptsetup to check LUKS2 label
|
||||
|
||||
libblkid on CentOS 7.6 doesn't support reading LUKS2 labels
|
||||
---
|
||||
tests/crypto_test.py | 7 +++++--
|
||||
1 file changed, 5 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/tests/crypto_test.py b/tests/crypto_test.py
|
||||
index 7320e74..b8aacee 100644
|
||||
--- a/tests/crypto_test.py
|
||||
+++ b/tests/crypto_test.py
|
||||
@@ -148,8 +148,11 @@ class CryptoTestFormat(CryptoTestCase):
|
||||
BlockDev.CryptoLUKSVersion.LUKS2, extra)
|
||||
self.assertTrue(succ)
|
||||
|
||||
- _ret, label, _err = run_command("lsblk -oLABEL -n %s" % self.loop_dev)
|
||||
- self.assertEqual(label, "blockdevLUKS")
|
||||
+ _ret, out, err = run_command("cryptsetup luksDump %s" % self.loop_dev)
|
||||
+ m = re.search(r"Label:\s*(\S+)\s*", out)
|
||||
+ if not m or len(m.groups()) != 1:
|
||||
+ self.fail("Failed to get label information from:\n%s %s" % (out, err))
|
||||
+ self.assertEqual(m.group(1), "blockdevLUKS")
|
||||
|
||||
# different key derivation function
|
||||
pbkdf = BlockDev.CryptoLUKSPBKDF(type="pbkdf2")
|
||||
--
|
||||
2.21.0
|
||||
|
||||
101
SOURCES/0007-fix-expected-cache-pool-name-with-newest-LVM.patch
Normal file
101
SOURCES/0007-fix-expected-cache-pool-name-with-newest-LVM.patch
Normal file
@ -0,0 +1,101 @@
|
||||
From 23e6f2024c34fc6e1b3a67c416334bba2b55d5a9 Mon Sep 17 00:00:00 2001
|
||||
From: Vojtech Trefny <vtrefny@redhat.com>
|
||||
Date: Thu, 31 Oct 2019 12:50:03 +0100
|
||||
Subject: [PATCH] Fix expected cache pool name with newest LVM
|
||||
|
||||
LVM now adds "_cpool" suffix to attached pools.
|
||||
---
|
||||
tests/lvm_dbus_tests.py | 17 ++++++++++++++++-
|
||||
tests/lvm_test.py | 19 +++++++++++++++++--
|
||||
2 files changed, 33 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/tests/lvm_dbus_tests.py b/tests/lvm_dbus_tests.py
|
||||
index 625a392..f2a17c9 100644
|
||||
--- a/tests/lvm_dbus_tests.py
|
||||
+++ b/tests/lvm_dbus_tests.py
|
||||
@@ -6,6 +6,7 @@ import overrides_hack
|
||||
import six
|
||||
import re
|
||||
import subprocess
|
||||
+from distutils.version import LooseVersion
|
||||
from itertools import chain
|
||||
|
||||
from utils import create_sparse_tempfile, create_lio_device, delete_lio_device, run_command, TestTags, tag_test
|
||||
@@ -31,6 +32,13 @@ class LVMTestCase(unittest.TestCase):
|
||||
else:
|
||||
BlockDev.reinit([cls.ps, cls.ps2], True, None)
|
||||
|
||||
+ def _get_lvm_version(self):
|
||||
+ _ret, out, _err = run_command("lvm version")
|
||||
+ m = re.search(r"LVM version:\s+([\d\.]+)", out)
|
||||
+ if not m or len(m.groups()) != 1:
|
||||
+ raise RuntimeError("Failed to determine LVM version from: %s" % out)
|
||||
+ return LooseVersion(m.groups()[0])
|
||||
+
|
||||
@unittest.skipUnless(lvm_dbus_running, "LVM DBus not running")
|
||||
class LvmNoDevTestCase(LVMTestCase):
|
||||
|
||||
@@ -1291,7 +1299,14 @@ class LvmPVVGcachedLVpoolTestCase(LvmPVVGLVTestCase):
|
||||
succ = BlockDev.lvm_cache_attach("testVG", "testLV", "testCache", None)
|
||||
self.assertTrue(succ)
|
||||
|
||||
- self.assertEqual(BlockDev.lvm_cache_pool_name("testVG", "testLV"), "testCache")
|
||||
+ lvm_version = self._get_lvm_version()
|
||||
+ if lvm_version < LooseVersion("2.03.06"):
|
||||
+ cpool_name = "testCache"
|
||||
+ else:
|
||||
+ # since 2.03.06 LVM adds _cpool suffix to the cache pool after attaching it
|
||||
+ cpool_name = "testCache_cpool"
|
||||
+
|
||||
+ self.assertEqual(BlockDev.lvm_cache_pool_name("testVG", "testLV"), cpool_name)
|
||||
|
||||
@unittest.skipUnless(lvm_dbus_running, "LVM DBus not running")
|
||||
class LvmPVVGcachedLVstatsTestCase(LvmPVVGLVTestCase):
|
||||
diff --git a/tests/lvm_test.py b/tests/lvm_test.py
|
||||
index 0b2c5ad..242ca94 100644
|
||||
--- a/tests/lvm_test.py
|
||||
+++ b/tests/lvm_test.py
|
||||
@@ -6,8 +6,9 @@ import overrides_hack
|
||||
import six
|
||||
import re
|
||||
import subprocess
|
||||
+from distutils.version import LooseVersion
|
||||
|
||||
-from utils import create_sparse_tempfile, create_lio_device, delete_lio_device, fake_utils, fake_path, skip_on, TestTags, tag_test
|
||||
+from utils import create_sparse_tempfile, create_lio_device, delete_lio_device, fake_utils, fake_path, skip_on, TestTags, tag_test, run_command
|
||||
from gi.repository import BlockDev, GLib
|
||||
|
||||
|
||||
@@ -25,6 +26,13 @@ class LVMTestCase(unittest.TestCase):
|
||||
else:
|
||||
BlockDev.reinit(cls.requested_plugins, True, None)
|
||||
|
||||
+ def _get_lvm_version(self):
|
||||
+ _ret, out, _err = run_command("lvm version")
|
||||
+ m = re.search(r"LVM version:\s+([\d\.]+)", out)
|
||||
+ if not m or len(m.groups()) != 1:
|
||||
+ raise RuntimeError("Failed to determine LVM version from: %s" % out)
|
||||
+ return LooseVersion(m.groups()[0])
|
||||
+
|
||||
|
||||
class LvmNoDevTestCase(LVMTestCase):
|
||||
def __init__(self, *args, **kwargs):
|
||||
@@ -1249,7 +1257,14 @@ class LvmPVVGcachedLVpoolTestCase(LvmPVVGLVTestCase):
|
||||
succ = BlockDev.lvm_cache_attach("testVG", "testLV", "testCache", None)
|
||||
self.assertTrue(succ)
|
||||
|
||||
- self.assertEqual(BlockDev.lvm_cache_pool_name("testVG", "testLV"), "testCache")
|
||||
+ lvm_version = self._get_lvm_version()
|
||||
+ if lvm_version < LooseVersion("2.03.06"):
|
||||
+ cpool_name = "testCache"
|
||||
+ else:
|
||||
+ # since 2.03.06 LVM adds _cpool suffix to the cache pool after attaching it
|
||||
+ cpool_name = "testCache_cpool"
|
||||
+
|
||||
+ self.assertEqual(BlockDev.lvm_cache_pool_name("testVG", "testLV"), cpool_name)
|
||||
|
||||
class LvmPVVGcachedLVstatsTestCase(LvmPVVGLVTestCase):
|
||||
@tag_test(TestTags.SLOW)
|
||||
--
|
||||
2.21.0
|
||||
|
||||
@ -19,7 +19,6 @@
|
||||
%define with_gi 1
|
||||
%define with_escrow 1
|
||||
%define with_dmraid 0
|
||||
%define with_tools 1
|
||||
|
||||
# python2 is not available on RHEL > 7 and not needed on Fedora > 29
|
||||
%if 0%{?rhel} > 7 || 0%{?fedora} > 29 || %{with_python2} == 0
|
||||
@ -45,12 +44,16 @@
|
||||
%define lvm_dbus_copts --without-lvm-dbus
|
||||
%endif
|
||||
|
||||
# vdo is not available on non-x86_64 on older RHEL
|
||||
%if (0%{?rhel} && 0%{?rhel} <= 7)
|
||||
%ifnarch x86_64 aarch64 s390x ppc64le
|
||||
# vdo is not available on Fedora
|
||||
%if (0%{?fedora}) || %{with_vdo} == 0
|
||||
%define with_vdo 0
|
||||
%define vdo_copts --without-vdo
|
||||
%endif
|
||||
|
||||
# vdo is available only on x86_64, aarch64, s390x and ppc64le
|
||||
%ifnarch x86_64 aarch64 s390x ppc64le
|
||||
%define with_vdo 0
|
||||
%define vdo_copts --without-vdo
|
||||
%endif
|
||||
|
||||
# btrfs is not available on RHEL > 7
|
||||
@ -59,11 +62,6 @@
|
||||
%define btrfs_copts --without-btrfs
|
||||
%endif
|
||||
|
||||
# dmraid is not available on RHEL > 7
|
||||
%if 0%{?rhel} > 7
|
||||
%define with_dmraid 0
|
||||
%endif
|
||||
|
||||
%if %{with_btrfs} != 1
|
||||
%define btrfs_copts --without-btrfs
|
||||
%endif
|
||||
@ -114,39 +112,33 @@
|
||||
%if %{with_vdo} != 1
|
||||
%define vdo_copts --without-vdo
|
||||
%endif
|
||||
%if %{with_tools} != 1
|
||||
%define tools_copts --without-tools
|
||||
%endif
|
||||
%if %{with_gi} != 1
|
||||
%define gi_copts --disable-introspection
|
||||
%endif
|
||||
|
||||
%define configure_opts %{?python2_copts} %{?python3_copts} %{?bcache_copts} %{?lvm_dbus_copts} %{?btrfs_copts} %{?crypto_copts} %{?dm_copts} %{?loop_copts} %{?lvm_copts} %{?lvm_dbus_copts} %{?mdraid_copts} %{?mpath_copts} %{?swap_copts} %{?kbd_copts} %{?part_copts} %{?fs_copts} %{?nvdimm_copts} %{?vdo_copts} %{?tools_copts} %{?gi_copts}
|
||||
%define configure_opts %{?python2_copts} %{?python3_copts} %{?bcache_copts} %{?lvm_dbus_copts} %{?btrfs_copts} %{?crypto_copts} %{?dm_copts} %{?loop_copts} %{?lvm_copts} %{?lvm_dbus_copts} %{?mdraid_copts} %{?mpath_copts} %{?swap_copts} %{?kbd_copts} %{?part_copts} %{?fs_copts} %{?nvdimm_copts} %{?vdo_copts} %{?gi_copts}
|
||||
|
||||
Name: libblockdev
|
||||
Version: 2.28
|
||||
Release: 7%{?dist}
|
||||
Version: 2.19
|
||||
Release: 12%{?dist}
|
||||
Summary: A library for low-level manipulation with block devices
|
||||
License: LGPLv2+
|
||||
URL: https://github.com/storaged-project/libblockdev
|
||||
Source0: https://github.com/storaged-project/libblockdev/releases/download/%{version}-%{release}/%{name}-%{version}.tar.gz
|
||||
Patch0: 0001-crypto-Fix-GError-overwrite-from-libvolume_key.patch
|
||||
Patch1: 0002-tests-Fix-test_swapon_pagesize-on-systems-with-64k-p.patch
|
||||
Patch2: 0003-part-Fix-segfault-when-adding-a-partition-too-big-fo.patch
|
||||
Patch3: 0004-lvm-Add-a-function-to-activate-LVs-in-shared-mode.patch
|
||||
Patch4: 0005-lvm-Add-support-for-starting-and-stopping-VG-locking.patch
|
||||
Patch5: 0006-Don-t-allow-suid-and-dev-set-on-fs-resize.patch
|
||||
Patch0: 0001-swap-error-codes.patch
|
||||
Patch1: 0002-major-minor-macros.patch
|
||||
Patch2: 0003-gating-tests-changes.patch
|
||||
Patch3: 0004-memory-leaks.patch
|
||||
Patch4: 0005-swap-status-on-dm.patch
|
||||
Patch5: 0006-use-cryptsetup-to-check-LUKS2-label.patch
|
||||
Patch6: 0007-fix-expected-cache-pool-name-with-newest-LVM.patch
|
||||
|
||||
BuildRequires: make
|
||||
BuildRequires: glib2-devel
|
||||
%if %{with_gi}
|
||||
BuildRequires: gobject-introspection-devel
|
||||
%endif
|
||||
%if %{with_python2}
|
||||
BuildRequires: python2-devel
|
||||
%else
|
||||
# Obsolete the python2 subpackage to avoid errors on upgrade
|
||||
Obsoletes: python2-blockdev < %{version}-%{release}
|
||||
%endif
|
||||
%if %{with_python3}
|
||||
BuildRequires: python3-devel
|
||||
@ -155,7 +147,6 @@ BuildRequires: python3-devel
|
||||
BuildRequires: gtk-doc
|
||||
%endif
|
||||
BuildRequires: glib2-doc
|
||||
BuildRequires: autoconf-archive
|
||||
|
||||
Requires: %{name}-utils%{?_isa} = %{version}-%{release}
|
||||
|
||||
@ -180,7 +171,6 @@ no information about VGs when creating an LV).
|
||||
Summary: Development files for libblockdev
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
Requires: glib2-devel
|
||||
Requires: %{name}-utils-devel%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
This package contains header files and pkg-config files needed for development
|
||||
@ -258,7 +248,6 @@ with the libblockdev-btrfs plugin/library.
|
||||
|
||||
%if %{with_crypto}
|
||||
%package crypto
|
||||
Requires: %{name}-utils%{?_isa} = %{version}-%{release}
|
||||
BuildRequires: cryptsetup-devel
|
||||
BuildRequires: libblkid-devel
|
||||
|
||||
@ -268,6 +257,7 @@ BuildRequires: nss-devel
|
||||
%endif
|
||||
|
||||
Summary: The crypto plugin for the libblockdev library
|
||||
Requires: %{name}-utils%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description crypto
|
||||
The libblockdev library plugin (and in the same time a standalone library)
|
||||
@ -399,6 +389,8 @@ BuildRequires: device-mapper-devel
|
||||
Summary: The LVM plugin for the libblockdev library
|
||||
Requires: %{name}-utils%{?_isa} = %{version}-%{release}
|
||||
Requires: lvm2
|
||||
# for thin_metadata_size
|
||||
Requires: device-mapper-persistent-data
|
||||
|
||||
%description lvm
|
||||
The libblockdev library plugin (and in the same time a standalone library)
|
||||
@ -421,6 +413,8 @@ BuildRequires: device-mapper-devel
|
||||
Summary: The LVM plugin for the libblockdev library
|
||||
Requires: %{name}-utils%{?_isa} = %{version}-%{release}
|
||||
Requires: lvm2-dbusd >= 2.02.156
|
||||
# for thin_metadata_size
|
||||
Requires: device-mapper-persistent-data
|
||||
|
||||
%description lvm-dbus
|
||||
The libblockdev library plugin (and in the same time a standalone library)
|
||||
@ -560,17 +554,8 @@ BuildRequires: libbytesize-devel
|
||||
BuildRequires: libyaml-devel
|
||||
Summary: The vdo plugin for the libblockdev library
|
||||
Requires: %{name}-utils%{?_isa} = %{version}-%{release}
|
||||
|
||||
# weak dependencies doesn't work on older RHEL
|
||||
%if (0%{?rhel} && 0%{?rhel} <= 7)
|
||||
Requires: vdo
|
||||
Requires: kmod-kvdo
|
||||
%else
|
||||
# we want to build the plugin everywhere but the dependencies might not be
|
||||
# available so just use weak dependency
|
||||
Recommends: vdo
|
||||
Recommends: kmod-kvdo
|
||||
%endif
|
||||
|
||||
%description vdo
|
||||
The libblockdev library plugin (and in the same time a standalone library)
|
||||
@ -587,20 +572,6 @@ This package contains header files and pkg-config files needed for development
|
||||
with the libblockdev-vdo plugin/library.
|
||||
%endif
|
||||
|
||||
%if %{with_tools}
|
||||
%package tools
|
||||
Summary: Various nice tools based on libblockdev
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Requires: %{name}-lvm = %{version}-%{release}
|
||||
BuildRequires: libbytesize-devel
|
||||
%if %{with_lvm_dbus} == 1
|
||||
Recommends: %{name}-lvm-dbus
|
||||
%endif
|
||||
|
||||
%description tools
|
||||
Various nice storage-related tools based on libblockdev.
|
||||
|
||||
%endif
|
||||
|
||||
%ifarch s390 s390x
|
||||
%package s390
|
||||
@ -688,7 +659,14 @@ A meta-package that pulls all the libblockdev plugins as dependencies.
|
||||
|
||||
|
||||
%prep
|
||||
%autosetup -n %{name}-%{version} -p1
|
||||
%setup -q -n %{name}-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch4 -p1
|
||||
%patch5 -p1
|
||||
%patch6 -p1
|
||||
|
||||
%build
|
||||
autoreconf -ivf
|
||||
@ -974,10 +952,6 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
|
||||
%{_includedir}/blockdev/vdo.h
|
||||
%endif
|
||||
|
||||
%if %{with_tools}
|
||||
%files tools
|
||||
%{_bindir}/lvm-cache-stats
|
||||
%endif
|
||||
|
||||
%ifarch s390 s390x
|
||||
%files s390
|
||||
@ -992,85 +966,13 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
|
||||
%files plugins-all
|
||||
|
||||
%changelog
|
||||
* Mon Jun 16 2025 Vojtech Trefny <vtrefny@redhat.com> - 2.28-7
|
||||
- Don't allow suid and dev set on fs resize (CVE-2025-6019)
|
||||
Resolves: RHEL-96034
|
||||
|
||||
* Wed Nov 08 2023 Vojtech Trefny <vtrefny@redhat.com> - 2.28-6
|
||||
- lvm: Add support for starting and stopping VG locking
|
||||
Resolves: RHEL-15923
|
||||
|
||||
* Thu Oct 19 2023 Vojtech Trefny <vtrefny@redhat.com> - 2.28-5
|
||||
- lvm: Add a function to activate LVs in shared mode
|
||||
Resolves: RHEL-14023
|
||||
|
||||
* Tue May 16 2023 Vojtech Trefny <vtrefny@redhat.com> - 2.28-4
|
||||
- Fix segfault when adding a partition too big for MSDOS
|
||||
Resolves: rhbz#2207500
|
||||
|
||||
* Mon Apr 03 2023 Vojtech Trefny <vtrefny@redhat.com> - 2.28-3
|
||||
- Fix test_swapon_pagesize on systems with 64k pages
|
||||
Resolves: rhbz#2138698
|
||||
|
||||
* Wed Nov 30 2022 Vojtech Trefny <vtrefny@redhat.com> - 2.28-2
|
||||
- Fix double free in write_escrow_data_file
|
||||
Resolves: rhbz#2142660
|
||||
|
||||
* Wed Sep 14 2022 Vojtech Trefny <vtrefny@redhat.com> - 2.28-1
|
||||
- Rebase to the latest upstream release 2.28
|
||||
Resolves: rhbz#2123347
|
||||
|
||||
* Mon Aug 08 2022 Vojtech Trefny <vtrefny@redhat.com> - 2.24-11
|
||||
- mdraid: Fix use after free
|
||||
Related: rhbz#2078815
|
||||
|
||||
* Mon Aug 08 2022 Vojtech Trefny <vtrefny@redhat.com> - 2.24-10
|
||||
- mdraid: Fix copy-paste error when checking return value
|
||||
Related: rhbz#2078815
|
||||
|
||||
* Fri Aug 05 2022 Vojtech Trefny <vtrefny@redhat.com> - 2.24-9
|
||||
- Fix getting UUID for DDF containers
|
||||
Resolves: rhbz#2078815
|
||||
|
||||
* Tue Dec 07 2021 Vojtech Trefny <vtrefny@redhat.com> - 2.24-8
|
||||
- Fix vdo stats calculation
|
||||
Resolves: rhbz#2023883
|
||||
|
||||
* Wed Jun 30 2021 Vojtech Trefny <vtrefny@redhat.com> - 2.24-7
|
||||
- Add workarounds for some LVM test issues
|
||||
Resolves: rhbz#1974352
|
||||
|
||||
* Fri May 14 2021 Vojtech Trefny <vtrefny@redhat.com> - 2.24-6
|
||||
- Fix default key size for non XTS ciphers
|
||||
Resolves: rhbz#1931847
|
||||
|
||||
* Mon Jan 11 2021 Vojtech Trefny <vtrefny@redhat.com> - 2.24-5
|
||||
- Fix LVM thin metadata calculation fix
|
||||
Resolves: rhbz#1901714
|
||||
|
||||
* Mon Dec 14 2020 Vojtech Trefny <vtrefny@redhat.com> - 2.24-4
|
||||
- LVM thin metadata calculation fix
|
||||
Resolves: rhbz#1901714
|
||||
|
||||
* Wed Nov 18 2020 Vojtech Trefny <vtrefny@redhat.com> - 2.24-3
|
||||
- exec: Polling fixes
|
||||
Resolves: rhbz#1884689
|
||||
|
||||
* Mon Nov 09 2020 Vojtech Trefny <vtrefny@redhat.com> - 2.24-2
|
||||
- exec: Fix setting locale for util calls
|
||||
Resolves: rhbz#1880031
|
||||
|
||||
* Fri May 22 2020 Vojtech Trefny <vtrefny@redhat.com> - 2.24-1
|
||||
- Rebased to the latest upstream release 2.24
|
||||
Resolves: rhbz#1824153
|
||||
|
||||
* Mon Dec 02 2019 Vojtech Trefny <vtrefny@redhat.com> - 2.19-12
|
||||
- Use cryptsetup to check LUKS2 label
|
||||
Resolves: rhbz#1778689
|
||||
- Fix expected cache pool name with newest LVM
|
||||
Related: rhbz#1778689
|
||||
|
||||
* Thu Jun 06 2019 Vojtech Trefny <vtrefny@redhat.com> - 2.19-11
|
||||
* Mon Jun 06 2019 Vojtech Trefny <vtrefny@redhat.com> - 2.19-11
|
||||
- Fix checking swap status on lvm/md (vtrefny)
|
||||
Resolves: rhbz#1649815
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user