New version

- Create the cache pool before the to-be-cached LV (vpodzime)
This commit is contained in:
Vratislav Podzimek 2015-11-25 09:23:22 +01:00
parent 5271bf024d
commit 40b9ebd08c
2 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,46 @@
From 546d495b13553f9d20be0b421e1cc4a9087b4b08 Mon Sep 17 00:00:00 2001
From: Vratislav Podzimek <vpodzime@redhat.com>
Date: Tue, 24 Nov 2015 13:03:43 +0100
Subject: [PATCH] Create the cache pool before the to-be-cached LV
Cache pool typically has harder restrictions for PV space (where it should be
allocated) than the LV.
Signed-off-by: Vratislav Podzimek <vpodzime@redhat.com>
---
src/plugins/lvm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/plugins/lvm.c b/src/plugins/lvm.c
index 30818c6..ead0d68 100644
--- a/src/plugins/lvm.c
+++ b/src/plugins/lvm.c
@@ -1736,12 +1736,6 @@ gboolean bd_lvm_cache_create_cached_lv (gchar *vg_name, gchar *lv_name, guint64
gboolean success = FALSE;
gchar *name = NULL;
- success = bd_lvm_lvcreate (vg_name, lv_name, data_size, NULL, slow_pvs, error);
- if (!success) {
- g_prefix_error (error, "Failed to create the data LV: ");
- return FALSE;
- }
-
name = g_strdup_printf ("%s_cache", lv_name);
success = bd_lvm_cache_create_pool (vg_name, name, cache_size, md_size, mode, flags, fast_pvs, error);
if (!success) {
@@ -1750,6 +1744,12 @@ gboolean bd_lvm_cache_create_cached_lv (gchar *vg_name, gchar *lv_name, guint64
return FALSE;
}
+ success = bd_lvm_lvcreate (vg_name, lv_name, data_size, NULL, slow_pvs, error);
+ if (!success) {
+ g_prefix_error (error, "Failed to create the data LV: ");
+ return FALSE;
+ }
+
success = bd_lvm_cache_attach (vg_name, lv_name, name, error);
if (!success) {
g_prefix_error (error, "Failed to attach the cache pool '%s' to the data LV: ", name);
--
2.5.0

View File

@ -1,12 +1,13 @@
Name: libblockdev
Version: 1.3
Release: 3%{?dist}
Release: 4%{?dist}
Summary: A library for low-level manipulation with block devices
License: LGPLv2+
URL: https://github.com/rhinstaller/libblockdev
Source0: https://github.com/rhinstaller/libblockdev/archive/%{name}-%{version}.tar.gz
Patch0: blockdev_c_annotation_fix.patch
Patch1: create_cache_pool_first.patch
BuildRequires: glib2-devel
BuildRequires: gobject-introspection-devel
@ -313,6 +314,7 @@ A meta-package that pulls all the libblockdev plugins as dependencies.
%prep
%setup -q -n %{name}-%{version}
%patch0 -p1
%patch1 -p1
%build
%configure
@ -477,6 +479,9 @@ find %{buildroot} -type f -name "*.la" | xargs %{__rm}
%files plugins-all
%changelog
* Wed Nov 25 2015 Vratislav Podzimek <vpodzime@redhat.com> - 1.3-4
- Create the cache pool before the to-be-cached LV (vpodzime)
* Thu Nov 05 2015 Robert Kuska <rkuska@redhat.com> - 1.3-3
- Rebuilt for Python3.5 rebuild