Fixes: use default cache mode when unset and add BuildRequires: device-mapper-persistent-data.

This commit is contained in:
Peter Rajnoha 2015-01-29 12:24:52 +01:00
parent 2ef3d710cf
commit 9f79d731dc
2 changed files with 44 additions and 3 deletions

View File

@ -0,0 +1,31 @@
WHATS_NEW | 4 ++++
lib/cache_segtype/cache.c | 4 +++-
2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 75c4569..2c481ae 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,3 +1,7 @@
+Version 2.02.116 -
+====================================
+ Set default cache_mode to writehrough when missing in metadata.
+
Version 2.02.115 - 21st January 2015
====================================
Report segment types without monitoring support as undefined.
diff --git a/lib/cache_segtype/cache.c b/lib/cache_segtype/cache.c
index 73839f4..afc0ec6 100644
--- a/lib/cache_segtype/cache.c
+++ b/lib/cache_segtype/cache.c
@@ -68,7 +68,9 @@ static int _cache_pool_text_import(struct lv_segment *seg,
return SEG_LOG_ERROR("cache_mode must be a string in");
if (!set_cache_pool_feature(&seg->feature_flags, str))
return SEG_LOG_ERROR("Unknown cache_mode in");
- }
+ } else
+ /* When missed in metadata, it's an old stuff - use writethrough */
+ seg->feature_flags |= DM_CACHE_FEATURE_WRITETHROUGH;
if (dm_config_has_node(sn, "policy")) {
if (!(str = dm_config_find_str(sn, "policy", NULL)))

View File

@ -40,7 +40,7 @@
Summary: Userland logical volume management tools
Name: lvm2
Version: 2.02.115
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv2
Group: System Environment/Base
URL: http://sources.redhat.com/lvm2
@ -48,6 +48,7 @@ Source0: ftp://sources.redhat.com/pub/lvm2/releases/LVM2.%{version}.tgz
Patch0: lvm2-set-default-preferred_names.patch
Patch1: lvm2-enable-lvmetad-by-default.patch
Patch2: lvm2-remove-mpath-device-handling-from-udev-rules.patch
Patch3: lvm2-2_02_116-set-default-cache_mode-when-unset-or-missing-in-metadata.patch
BuildRequires: libselinux-devel >= %{libselinux_version}, libsepol-devel
BuildRequires: libblkid-devel >= %{util_linux_version}
@ -65,13 +66,16 @@ BuildRequires: systemd-units
BuildRequires: python2-devel
BuildRequires: python-setuptools
%endif
%if %{enable_thin} || %{enable_cache}
BuildRequires: device-mapper-persistent-data >= %{persistent_data_version}
%endif
Requires: %{name}-libs = %{version}-%{release}
Requires: bash >= %{bash_version}
Requires(post): systemd-units >= %{systemd_version}, systemd-sysv
Requires(preun): systemd-units >= %{systemd_version}
Requires(postun): systemd-units >= %{systemd_version}
Requires: module-init-tools
%if %{enable_thin}
%if %{enable_thin} || %{enable_cache}
Requires: device-mapper-persistent-data >= %{persistent_data_version}
%endif
@ -88,6 +92,7 @@ or more physical volumes and creating one or more logical volumes
%patch0 -p1 -b .preferred_names
%patch1 -p1 -b .enable_lvmetad
%patch2 -p1 -b .udev_no_mpath
%patch3 -p1 -b .cache_mode_mda
%build
%define _default_pid_dir /run
@ -105,7 +110,7 @@ or more physical volumes and creating one or more logical volumes
%endif
%if %{enable_thin}
%define configure_thin --with-thin=internal --with-thin-check=%{_sbindir}/thin_check --with-thin-dump=%{_sbindir}/thin_dump --with-thin-repair=%{_sbindir}/thin_repair
%define configure_thin --with-thin=internal
%endif
%if %{enable_lvmetad}
@ -638,6 +643,11 @@ the device-mapper event library.
%{_libdir}/pkgconfig/devmapper-event.pc
%changelog
* Thu Jan 29 2015 Peter Rajnoha <prajnoha@redhat.com> - 2.02.115-2
- Set default cache_mode to writehrough when missing in metadata.
- Add BuildRequires: device-mapper-persistent-data
for proper thin and cache tool configuration.
* Thu Jan 22 2015 Peter Rajnoha <prajnoha@redhat.com> - 2.02.115-1
- Report segment types without monitoring support as undefined.
- Support lvchange --errorwhenfull for thin pools.