From d793d16b1ea4f23577b881890fa9d3535df57554 Mon Sep 17 00:00:00 2001 From: Vratislav Podzimek Date: Mon, 4 Jan 2016 15:07:33 +0100 Subject: [PATCH] New version - Round size in thpoolcreate() to KiB (vpodzime) --- libblockdev.spec | 8 +++++++- thpoolcreate_round_size.patch | 29 +++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 thpoolcreate_round_size.patch diff --git a/libblockdev.spec b/libblockdev.spec index e36d5b2..7a403fd 100644 --- a/libblockdev.spec +++ b/libblockdev.spec @@ -1,6 +1,6 @@ Name: libblockdev Version: 1.3 -Release: 4%{?dist} +Release: 5%{?dist} Summary: A library for low-level manipulation with block devices License: LGPLv2+ URL: https://github.com/rhinstaller/libblockdev @@ -8,6 +8,7 @@ Source0: https://github.com/rhinstaller/libblockdev/archive/%{name}-%{versio Patch0: blockdev_c_annotation_fix.patch Patch1: create_cache_pool_first.patch +Patch2: thpoolcreate_round_size.patch BuildRequires: glib2-devel BuildRequires: gobject-introspection-devel @@ -315,6 +316,7 @@ A meta-package that pulls all the libblockdev plugins as dependencies. %setup -q -n %{name}-%{version} %patch0 -p1 %patch1 -p1 +%patch2 -p1 %build %configure @@ -479,6 +481,10 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm} %files plugins-all %changelog +* Mon Jan 04 2016 Vratislav Podzimek - 1.3-5 +- Round size in thpoolcreate() to KiB (vpodzime) + Resolves: rhbz#1289937 + * Wed Nov 25 2015 Vratislav Podzimek - 1.3-4 - Create the cache pool before the to-be-cached LV (vpodzime) diff --git a/thpoolcreate_round_size.patch b/thpoolcreate_round_size.patch new file mode 100644 index 0000000..550a680 --- /dev/null +++ b/thpoolcreate_round_size.patch @@ -0,0 +1,29 @@ +From 45e63e5b107efb887a64c32c639f22b558c352d7 Mon Sep 17 00:00:00 2001 +From: Vratislav Podzimek +Date: Mon, 4 Jan 2016 08:28:50 +0100 +Subject: [PATCH] Round size in thpoolcreate() to KiB + +Otherwise LVM may complain about the size not being a multiple of 512. See +https://bugzilla.redhat.com/show_bug.cgi?id=1224638 for more details. + +Signed-off-by: Vratislav Podzimek +--- + src/plugins/lvm.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c +index ead0d68..4f7e0e2 100644 +--- a/src/plugins/lvm.c ++++ b/src/plugins/lvm.c +@@ -1364,7 +1364,7 @@ gboolean bd_lvm_thpoolcreate (gchar *vg_name, gchar *lv_name, guint64 size, guin + guint8 next_arg = 4; + gboolean success = FALSE; + +- args[3] = g_strdup_printf ("%"G_GUINT64_FORMAT"b", size); ++ args[3] = g_strdup_printf ("%"G_GUINT64_FORMAT"K", size/1024); + + if (md_size != 0) { + args[next_arg] = g_strdup_printf("--poolmetadatasize=%"G_GUINT64_FORMAT"b", md_size); +-- +2.5.0 +