From 9f79d731dcae6c6143aad7c03d23db5ed3fd0669 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Jan 29 2015 11:24:52 +0000 Subject: Fixes: use default cache mode when unset and add BuildRequires: device-mapper-persistent-data. --- diff --git a/lvm2-2_02_116-set-default-cache_mode-when-unset-or-missing-in-metadata.patch b/lvm2-2_02_116-set-default-cache_mode-when-unset-or-missing-in-metadata.patch new file mode 100644 index 0000000..7d5b904 --- /dev/null +++ b/lvm2-2_02_116-set-default-cache_mode-when-unset-or-missing-in-metadata.patch @@ -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))) diff --git a/lvm2.spec b/lvm2.spec index ccb8871..25f919a 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -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 - 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 - 2.02.115-1 - Report segment types without monitoring support as undefined. - Support lvchange --errorwhenfull for thin pools.