Hello community, here is the log from the commit of package lvm2 for openSUSE:Factory checked in at 2017-10-26 18:40:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/lvm2 (Old) and /work/SRC/openSUSE:Factory/.lvm2.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "lvm2" Thu Oct 26 18:40:14 2017 rev:109 rq:535964 version:2.02.175 Changes: -------- --- /work/SRC/openSUSE:Factory/lvm2/device-mapper.changes 2017-09-09 20:23:06.807024920 +0200 +++ /work/SRC/openSUSE:Factory/.lvm2.new/device-mapper.changes 2017-10-26 18:40:20.735258400 +0200 @@ -1,0 +2,27 @@ +Mon Oct 23 07:50:33 UTC 2017 - z...@suse.com + +- Update to LVM2.2.02.175 +- Use week dependency for lvm2-lockd on libdlm and sanlock +- Rename/refresh patches: + - display-dm-name-for-lv-name.diff to fate-309425_display-dm-name-for-lv-name.patch + - fsadm-add-support-for-btrfs.patch to fate-31841_fsadm-add-support-for-btrfs.patch + - dmeventd-fix-dso-name-wrong-compare.patch to bug-935623_dmeventd-fix-dso-name-wrong-compare.patch + - lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch to bug-960044_lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch + - simplify-special-case-for-md-in-69-dm-lvm-metadata.patch to bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch + - lvm2-testsuite.patch to bug-950089_test-fix-lvm2-testsuite-build-error.patch + +------------------------------------------------------------------- +Thu Sep 14 09:51:18 UTC 2017 - z...@suse.com + +- Drop resource agents for clvmd and cmirror (bsc#1058680) + - clvmd.ocf + - cmirrord.ocf +- Drop all patches for cmirror (bsc#1058661) + - cluster_support_mirrord_log.diff + - cmirrord_improvment_performance.patch + - lvconvert-cluster-mirrored-disk-failed.patch + - improve-mirror-legs-on-different-tag-pvs.patch + - make-mirror-legs-on-different-tag-pvs.patch + - use-mirrortype-asdefault-whenclvmdrunning.patch + +------------------------------------------------------------------- lvm2-clvm.changes: same change lvm2.changes: same change Old: ---- LVM2.2.02.173.tgz LVM2.2.02.173.tgz.asc cluster_support_mirrord_log.diff clvmd.ocf cmirrord.ocf cmirrord_improvment_performance.patch display-dm-name-for-lv-name.diff dmeventd-fix-dso-name-wrong-compare.patch fsadm-add-support-for-btrfs.patch improve-mirror-legs-on-different-tag-pvs.patch lvconvert-cluster-mirrored-disk-failed.patch lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch lvm2-testsuite.patch make-mirror-legs-on-different-tag-pvs.patch simplify-special-case-for-md-in-69-dm-lvm-metadata.patch use-mirrortype-asdefault-whenclvmdrunning.patch New: ---- LVM2.2.02.175.tgz LVM2.2.02.175.tgz.asc bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch bug-935623_dmeventd-fix-dso-name-wrong-compare.patch bug-950089_test-fix-lvm2-testsuite-build-error.patch bug-960044_lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch fate-309425_display-dm-name-for-lv-name.patch fate-31841_fsadm-add-support-for-btrfs.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ device-mapper.spec ++++++ --- /var/tmp/diff_new_pack.VDyctT/_old 2017-10-26 18:40:28.206909793 +0200 +++ /var/tmp/diff_new_pack.VDyctT/_new 2017-10-26 18:40:28.210909606 +0200 @@ -19,8 +19,8 @@ %define libname libdevmapper1_03 %define libname_event libdevmapper-event1_03 ### COMMON-DEF-BEGIN ### -%define lvm2_version 2.02.173 -%define device_mapper_version 1.02.142 +%define lvm2_version 2.02.175 +%define device_mapper_version 1.02.144 %define thin_provisioning_version 0.7.0 ### COMMON-DEF-END ### Name: device-mapper @@ -52,27 +52,17 @@ # Never upstream Patch1001: cmirrord_remove_date_time_from_compilation.patch #fate#309425 -Patch1002: display-dm-name-for-lv-name.diff -#fate#312248 -Patch1003: make-mirror-legs-on-different-tag-pvs.patch -Patch1004: improve-mirror-legs-on-different-tag-pvs.patch -#fate#315092 -Patch1005: cmirrord_improvment_performance.patch -#fate#314367 -Patch1006: cluster_support_mirrord_log.diff -Patch1007: lvconvert-cluster-mirrored-disk-failed.patch +Patch1002: fate-309425_display-dm-name-for-lv-name.patch #FATE#318413 -Patch1008: fsadm-add-support-for-btrfs.patch -#bnc#870824 -Patch1009: use-mirrortype-asdefault-whenclvmdrunning.patch +Patch1003: fate-31841_fsadm-add-support-for-btrfs.patch #bsc#935623 -Patch1010: dmeventd-fix-dso-name-wrong-compare.patch +Patch1004: bug-935623_dmeventd-fix-dso-name-wrong-compare.patch #bsc#960044 -Patch1011: lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch +Patch1005: bug-960044_lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch #SUSE patches 2000+ for device mapper, udev rules #bsc#1012973 -Patch2006: simplify-special-case-for-md-in-69-dm-lvm-metadata.patch +Patch2006: bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch ### COMMON-PATCH-END ### %description @@ -86,12 +76,6 @@ %patch1003 -p1 %patch1004 -p1 %patch1005 -p1 -%patch1006 -p1 -%patch1007 -p1 -%patch1008 -p1 -%patch1009 -p1 -%patch1010 -p1 -%patch1011 -p1 %patch2006 -p1 ### COMMON-PREP-END ### @@ -100,7 +84,8 @@ ### COMMON-CONFIG-BEGIN ### export PATH=$PATH:/sbin:%{_prefix}/sbin -sed -ie "s/%{device_mapper_version}/1.03.01/g" VERSION_DM +# Why this messy fix here? someone released a wrong version... +sed -ie "s/1.02.*/1.03.01/g" VERSION_DM %configure \ --enable-dmeventd \ --enable-cmdlib \ ++++++ lvm2-clvm.spec ++++++ --- /var/tmp/diff_new_pack.VDyctT/_old 2017-10-26 18:40:28.262907180 +0200 +++ /var/tmp/diff_new_pack.VDyctT/_new 2017-10-26 18:40:28.266906994 +0200 @@ -19,8 +19,8 @@ %define dlm_version 3.99.1 %define sanlock_version 3.3.0 ### COMMON-DEF-BEGIN ### -%define lvm2_version 2.02.173 -%define device_mapper_version 1.02.142 +%define lvm2_version 2.02.175 +%define device_mapper_version 1.02.144 %define thin_provisioning_version 0.7.0 ### COMMON-DEF-END ### Name: lvm2-clvm @@ -32,8 +32,6 @@ Url: http://sources.redhat.com/cluster/clvm/ Source: ftp://sources.redhat.com/pub/lvm2/LVM2.%{lvm2_version}.tgz Source1: ftp://sources.redhat.com/pub/lvm2/LVM2.%{lvm2_version}.tgz.asc -Source2: clvmd.ocf -Source3: cmirrord.ocf BuildRequires: libcorosync-devel BuildRequires: libdlm-devel >= %{dlm_version} BuildRequires: pkgconfig @@ -55,27 +53,17 @@ # Never upstream Patch1001: cmirrord_remove_date_time_from_compilation.patch #fate#309425 -Patch1002: display-dm-name-for-lv-name.diff -#fate#312248 -Patch1003: make-mirror-legs-on-different-tag-pvs.patch -Patch1004: improve-mirror-legs-on-different-tag-pvs.patch -#fate#315092 -Patch1005: cmirrord_improvment_performance.patch -#fate#314367 -Patch1006: cluster_support_mirrord_log.diff -Patch1007: lvconvert-cluster-mirrored-disk-failed.patch +Patch1002: fate-309425_display-dm-name-for-lv-name.patch #FATE#318413 -Patch1008: fsadm-add-support-for-btrfs.patch -#bnc#870824 -Patch1009: use-mirrortype-asdefault-whenclvmdrunning.patch +Patch1003: fate-31841_fsadm-add-support-for-btrfs.patch #bsc#935623 -Patch1010: dmeventd-fix-dso-name-wrong-compare.patch +Patch1004: bug-935623_dmeventd-fix-dso-name-wrong-compare.patch #bsc#960044 -Patch1011: lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch +Patch1005: bug-960044_lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch #SUSE patches 2000+ for device mapper, udev rules #bsc#1012973 -Patch2006: simplify-special-case-for-md-in-69-dm-lvm-metadata.patch +Patch2006: bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch ### COMMON-PATCH-END ### %description @@ -90,12 +78,6 @@ %patch1003 -p1 %patch1004 -p1 %patch1005 -p1 -%patch1006 -p1 -%patch1007 -p1 -%patch1008 -p1 -%patch1009 -p1 -%patch1010 -p1 -%patch1011 -p1 %patch2006 -p1 ### COMMON-PREP-END ### @@ -119,7 +101,8 @@ ### COMMON-CONFIG-BEGIN ### export PATH=$PATH:/sbin:%{_prefix}/sbin -sed -ie "s/%{device_mapper_version}/1.03.01/g" VERSION_DM +# Why this messy fix here? someone released a wrong version... +sed -ie "s/1.02.*/1.03.01/g" VERSION_DM %configure \ --enable-dmeventd \ --enable-cmdlib \ @@ -156,10 +139,6 @@ install -m0644 -D man/lvmlockd.8 %{buildroot}%{_mandir}/man8/lvmlockd.8 install -m0644 -D man/lvmlockctl.8 %{buildroot}%{_mandir}/man8/lvmlockctl.8 -# ocf files -install -m755 -D %{SOURCE2} "%{buildroot}/%{_libexecdir}/ocf/resource.d/lvm2/clvmd" -install -m755 -D %{SOURCE3} "%{buildroot}/%{_libexecdir}/ocf/resource.d/lvm2/cmirrord" - # rc services symlinks ln -s service %{buildroot}%{_sbindir}/rclvm2-cluster-activation ln -s service %{buildroot}%{_sbindir}/rclvm2-clvmd @@ -185,10 +164,6 @@ %{_sbindir}/clvmd %{_sbindir}/rclvm2-cluster-activation %{_sbindir}/rclvm2-clvmd -%dir %{_libexecdir}/ocf -%dir %{_libexecdir}/ocf/resource.d -%dir %{_libexecdir}/ocf/resource.d/lvm2 -%{_libexecdir}/ocf/resource.d/lvm2/clvmd %{_unitdir}/lvm2-clvmd.service %{_unitdir}/lvm2-cluster-activation.service %{_libexecdir}/systemd/lvm2-cluster-activation @@ -208,7 +183,6 @@ %files -n lvm2-cmirrord %defattr(-,root,root) %{_sbindir}/cmirrord -%{_libexecdir}/ocf/resource.d/lvm2/cmirrord %{_libexecdir}/systemd/system/lvm2-cmirrord.service %{_sbindir}/rclvm2-cmirrord %{_mandir}/man8/cmirrord.8%{ext_man} @@ -216,8 +190,8 @@ %package -n lvm2-lockd Summary: LVM locking daemon Group: Productivity/Clustering/HA -Requires: libdlm >= %{dlm_version} -Requires: libsanlock1 >= %{sanlock_version} +Recommends: libdlm >= %{dlm_version} +Recommends: libsanlock1 >= %{sanlock_version} Requires: lvm2 = %{version} %{?systemd_requires} ++++++ lvm2.spec ++++++ --- /var/tmp/diff_new_pack.VDyctT/_old 2017-10-26 18:40:28.298905501 +0200 +++ /var/tmp/diff_new_pack.VDyctT/_new 2017-10-26 18:40:28.302905314 +0200 @@ -21,8 +21,8 @@ %define cmdlib liblvm2cmd2_02 ### COMMON-DEF-BEGIN ### -%define lvm2_version 2.02.173 -%define device_mapper_version 1.02.142 +%define lvm2_version 2.02.175 +%define device_mapper_version 1.02.144 %define thin_provisioning_version 0.7.0 ### COMMON-DEF-END ### @@ -63,33 +63,22 @@ # Never upstream Patch1001: cmirrord_remove_date_time_from_compilation.patch #fate#309425 -Patch1002: display-dm-name-for-lv-name.diff -#fate#312248 -Patch1003: make-mirror-legs-on-different-tag-pvs.patch -Patch1004: improve-mirror-legs-on-different-tag-pvs.patch -#fate#315092 -Patch1005: cmirrord_improvment_performance.patch -#fate#314367 -Patch1006: cluster_support_mirrord_log.diff -Patch1007: lvconvert-cluster-mirrored-disk-failed.patch +Patch1002: fate-309425_display-dm-name-for-lv-name.patch #FATE#318413 -Patch1008: fsadm-add-support-for-btrfs.patch -#bnc#870824 -Patch1009: use-mirrortype-asdefault-whenclvmdrunning.patch +Patch1003: fate-31841_fsadm-add-support-for-btrfs.patch #bsc#935623 -Patch1010: dmeventd-fix-dso-name-wrong-compare.patch +Patch1004: bug-935623_dmeventd-fix-dso-name-wrong-compare.patch #bsc#960044 -Patch1011: lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch +Patch1005: bug-960044_lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch #SUSE patches 2000+ for device mapper, udev rules #bsc#1012973 -Patch2006: simplify-special-case-for-md-in-69-dm-lvm-metadata.patch +Patch2006: bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch ### COMMON-PATCH-END ### # 3000+ for test code -#bnc#950089 -Patch3001: lvm2-testsuite.patch #bsc#1043040 +Patch3001: bug-950089_test-fix-lvm2-testsuite-build-error.patch Patch3002: bug-1043040_test-fix-read-ahead-issues-in-test-scripts.patch #bsc#1037309 @@ -107,12 +96,6 @@ %patch1003 -p1 %patch1004 -p1 %patch1005 -p1 -%patch1006 -p1 -%patch1007 -p1 -%patch1008 -p1 -%patch1009 -p1 -%patch1010 -p1 -%patch1011 -p1 %patch2006 -p1 ### COMMON-PREP-END ### @@ -136,7 +119,8 @@ ### COMMON-CONFIG-BEGIN ### export PATH=$PATH:/sbin:%{_prefix}/sbin -sed -ie "s/%{device_mapper_version}/1.03.01/g" VERSION_DM +# Why this messy fix here? someone released a wrong version... +sed -ie "s/1.02.*/1.03.01/g" VERSION_DM %configure \ --enable-dmeventd \ --enable-cmdlib \ @@ -201,8 +185,8 @@ rm %{buildroot}%{_unitdir}/lvm2-lvmlockd.service rm %{buildroot}%{_unitdir}/lvm2-lvmlocking.service rm %{buildroot}%{_includedir}/libdevmapper*.h -rm %{buildroot}%{_libdir}/libdevmapper.so.1.03 -rm %{buildroot}%{_libdir}/libdevmapper-event.so.1.03 +rm %{buildroot}%{_libdir}/libdevmapper.so.* +rm %{buildroot}%{_libdir}/libdevmapper-event.so.* rm %{buildroot}%{_libdir}/libdevmapper.so rm %{buildroot}%{_libdir}/libdevmapper-event.so rm %{buildroot}%{_libdir}/pkgconfig/devmapper*.pc ++++++ LVM2.2.02.173.tgz -> LVM2.2.02.175.tgz ++++++ ++++ 7086 lines of diff (skipped) ++++++ bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch ++++++ >From 0913b597d61b9b430654d7ab06528cdfcfaf06f4 Mon Sep 17 00:00:00 2001 From: NeilBrown <ne...@suse.com> Date: Wed, 4 Jan 2017 14:20:53 +1100 Subject: [PATCH] Simplify special-case for md in 69-dm-lvm-metadata.rules This special casing brings little value. It appears to attempt to determine if the array is active yet or not, and to skip processing if the array has not yet been started. However, if the array hasn't been started, then "blkid" will not have been able to read a signature, so: ENV{ID_FS_TYPE}!="LVM2_member|LVM1_member", GOTO="lvm_end" will have caused all this code to be skipped. Further, this code causes incorrect behaviour in at least one case. It assumes that the first "add" event should be ignored, as it will be followed by a "change" event which indicates the array coming on line. This is consistent with how the kernel sends events, but not always consistent with how this script sees event. Specifically: if the initrd has "mdadm" support installed, but not "lvm2" support, then the initial "add" and "change" events will happen while the initrd is in charge and this file is not available. Once the root filesystem is mountd, this file will be available and "udevadm trigger --action=add" will be run. So the first and only event seen by this script for an md device will be "add", and it will incorrectly ignore it. So replace the special handling with code that simply jumps to lvm_scan on any 'add' or 'change' event. Signed-off-by: NeilBrown <ne...@suse.com> --- udev/69-dm-lvm-metad.rules.in | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in index bd75fc8efcd5..fcbb7f755eba 100644 --- a/udev/69-dm-lvm-metad.rules.in +++ b/udev/69-dm-lvm-metad.rules.in @@ -51,13 +51,11 @@ ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", ENV{DM_ACTIVATION}=="1", GOTO="lvm_scan" GOTO="lvm_end" # MD device: +# Need to scan on both 'add' and 'change' LABEL="next" KERNEL!="md[0-9]*", GOTO="next" -IMPORT{db}="LVM_MD_PV_ACTIVATED" -ACTION=="add", ENV{LVM_MD_PV_ACTIVATED}=="1", GOTO="lvm_scan" -ACTION=="change", ENV{LVM_MD_PV_ACTIVATED}!="1", TEST=="md/array_state", ENV{LVM_MD_PV_ACTIVATED}="1", GOTO="lvm_scan" -ACTION=="add", KERNEL=="md[0-9]*p[0-9]*", GOTO="lvm_scan" -ENV{LVM_MD_PV_ACTIVATED}!="1", ENV{SYSTEMD_READY}="0" +ACTION=="add", GOTO="lvm_scan" +ACTION=="change", GOTO="lvm_scan" GOTO="lvm_end" # Loop device: -- 2.11.0 ++++++ bug-935623_dmeventd-fix-dso-name-wrong-compare.patch ++++++ >From d5246ee0d534677439cf4af780422fbb2c9068b2 Mon Sep 17 00:00:00 2001 From: Liuhua Wang <lw...@suse.com> Date: Thu, 9 Jul 2015 15:44:20 +0800 Subject: [PATCH] dmeventd: fix dso name wrong compare dso_name is thought as not empty and doesn't create monitor thread, because lvm sets empty dso_name with "-". Signed-off-by: Liuhua Wang <lw...@suse.com> References: bnc#935623 --- daemons/dmeventd/dmeventd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git LVM2.2.02.120.orig/daemons/dmeventd/dmeventd.c LVM2.2.02.120/daemons/dmeventd/dmeventd.c index e8d1e3b..3b1952c 100644 --- LVM2.2.02.120.orig/daemons/dmeventd/dmeventd.c +++ LVM2.2.02.120/daemons/dmeventd/dmeventd.c @@ -1218,12 +1218,12 @@ static int _want_registered_device(char *dso_name, char *device_uuid, struct thread_status *thread) { /* If DSO names and device paths are equal. */ - if (dso_name && device_uuid) + if (dso_name && strcmp(dso_name, "-") && device_uuid) return !strcmp(dso_name, thread->dso_data->dso_name) && !strcmp(device_uuid, thread->device.uuid); /* If DSO names are equal. */ - if (dso_name) + if (dso_name && strcmp(dso_name, "-")) return !strcmp(dso_name, thread->dso_data->dso_name); /* If device paths are equal. */ -- 1.8.4.5 ++++++ bug-950089_test-fix-lvm2-testsuite-build-error.patch ++++++ commit 0402acbbb9f8f6066a3f7899e8cc3ae72b84ee20 Author: Zhilong Liu <zl...@suse.com> Date: Wed Dec 7 02:43:10 2016 -0500 add a new test package named lvm2-testsuite(bnc#950089) + lvm2-testsuite.patch Currently this new package is not enabled by default. Please set enable_testsuite to 1 to turn it on in the spec file. Eric: This patch is to solve the following obs building error: """ E: arch-dependent-file-in-usr-share (Badness: 590) /usr/share/lvm2-testsuite/api/lvtest.t ... """ So, move the *.t binary into /usr/lib/lvm2-testsuite/. Signed-off-by: Zhilong Liu <zl...@suse.com> diff --git a/test/Makefile.in b/test/Makefile.in index f152868..f0845d7 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -224,7 +224,7 @@ install: .tests-stamp lib/paths-installed $(INSTALL_DATA) shell/*.sh $(DATADIR)/shell $(INSTALL_DATA) api/*.sh $(DATADIR)/api $(INSTALL_DATA) lib/mke2fs.conf $(DATADIR)/lib - $(INSTALL_PROGRAM) api/*.{t,py} $(DATADIR)/api + $(INSTALL_PROGRAM) api/*.py $(DATADIR)/api/ $(INSTALL_PROGRAM) dbus/*.py $(DATADIR)/dbus/ $(INSTALL_DATA) lib/paths-installed $(DATADIR)/lib/paths cd lib && $(INSTALL_DATA) \ @@ -244,6 +244,7 @@ install: .tests-stamp lib/paths-installed @cd $(EXECDIR) && for i in $(LIB_LINK_NOT); do \ echo "$(LN_S) -f not $$i"; \ $(LN_S) -f not $$i; done + $(INSTALL_PROGRAM) api/*.t $(EXECDIR) $(INSTALL_PROGRAM) -D lib/runner $(bindir)/lvm2-testsuite lib/should: lib/not ++++++ bug-960044_lvm2-lvmetad.service-add-Also-lvm2-lvmetad.socket.patch ++++++ >From 4b846bba24f8458130fa951f9248a7540084f641 Mon Sep 17 00:00:00 2001 From: Liuhua Wang <lw...@suse.com> Date: Tue, 29 Dec 2015 15:15:27 +0800 Subject: [PATCH] lvm2-lvmetad.service add Also=lvm2-lvmetad.socket In order to avoid lvm2-lvmetad.service being activated when package updating due to `systemctl restart/try-restart .socket` results in corresponding service being activeted, we removed lvm2-lvmetad.socket from %preun and %postun(bsc#914415), which causes brokent lvm2-lvmetad .socket symbolic link left when package being uninstalled. Add 'Also=lvm2-lvmetad.socket' in '[Install]' section of lvm2-lvmetad. service to remove lvm2-lvmetad.socket when disable lvm2-lvmetad.service. References: bsc#960044 Signed-off-by: lw...@suse.com --- scripts/lvm2_lvmetad_systemd_red_hat.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/lvm2_lvmetad_systemd_red_hat.service.in b/scripts/lvm2_lvmetad_systemd_red_hat.service.in index 8f4c60d..1deca87 100644 --- a/scripts/lvm2_lvmetad_systemd_red_hat.service.in +++ b/scripts/lvm2_lvmetad_systemd_red_hat.service.in @@ -15,4 +15,5 @@ Restart=on-abort PIDFile=@LVMETAD_PIDFILE@ [Install] +Also=lvm2-lvmetad.socket WantedBy=sysinit.target -- 1.8.4.5 ++++++ fate-309425_display-dm-name-for-lv-name.patch ++++++ --- lib/config/config_settings.h | 3 +++ lib/config/defaults.h | 1 + lib/display/display.c | 13 +++++++++---- 3 files changed, 13 insertions(+), 4 deletions(-) Index: LVM2.2.02.170/lib/config/config_settings.h =================================================================== --- LVM2.2.02.170.orig/lib/config/config_settings.h +++ LVM2.2.02.170/lib/config/config_settings.h @@ -1039,6 +1039,9 @@ cfg(global_fsadm_executable_CFG, "fsadm_ "The full path to the fsadm command.\n" "LVM uses this command to help with lvresize -r operations.\n") +cfg(global_display_dm_name_for_lv_name_CFG, "display_dm_name_for_lv_name", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_DISPLAY_DM_NAME_FOR_LV_NAME, vsn(2, 2, 98), NULL, 0, NULL, + "Display dm name for lv name.\n") + cfg(global_system_id_source_CFG, "system_id_source", global_CFG_SECTION, 0, CFG_TYPE_STRING, DEFAULT_SYSTEM_ID_SOURCE, vsn(2, 2, 117), NULL, 0, NULL, "The method LVM uses to set the local system ID.\n" "Volume Groups can also be given a system ID (by vgcreate, vgchange,\n" Index: LVM2.2.02.170/lib/config/defaults.h =================================================================== --- LVM2.2.02.170.orig/lib/config/defaults.h +++ LVM2.2.02.170/lib/config/defaults.h @@ -33,6 +33,7 @@ #define DEFAULT_OBTAIN_DEVICE_LIST_FROM_UDEV 1 #define DEFAULT_EXTERNAL_DEVICE_INFO_SOURCE "none" #define DEFAULT_SYSFS_SCAN 1 +#define DEFAULT_DISPLAY_DM_NAME_FOR_LV_NAME 0 #define DEFAULT_MD_COMPONENT_DETECTION 1 #define DEFAULT_FW_RAID_COMPONENT_DETECTION 0 #define DEFAULT_MD_CHUNK_ALIGNMENT 1 Index: LVM2.2.02.170/lib/display/display.c =================================================================== --- LVM2.2.02.170.orig/lib/display/display.c +++ LVM2.2.02.170/lib/display/display.c @@ -413,10 +413,15 @@ int lvdisplay_full(struct cmd_context *c lv->vg->cmd->dev_dir, lv->vg->name, lv->name); else if (lv_is_visible(lv)) { /* Thin pool does not have /dev/vg/name link */ - if (!lv_is_thin_pool(lv)) - log_print("LV Path %s%s/%s", - lv->vg->cmd->dev_dir, - lv->vg->name, lv->name); + if (!lv_is_thin_pool(lv)) { + if (find_config_tree_bool(cmd, global_display_dm_name_for_lv_name_CFG, NULL)) { + log_print("LV Path %smapper/%s-%s", lv->vg->cmd->dev_dir, + lv->vg->name, lv->name); + } else { + log_print("LV Path %s%s/%s", lv->vg->cmd->dev_dir, + lv->vg->name, lv->name); + } + } log_print("LV Name %s", lv->name); } else log_print("Internal LV Name %s", lv->name); ++++++ fate-31841_fsadm-add-support-for-btrfs.patch ++++++ >From ecc163a3cb10a8ad89a445ec9d6fdb5a30c380de Mon Sep 17 00:00:00 2001 From: Eric Ren <z...@suse.com> Date: Thu, 6 Jul 2017 17:42:58 +0800 Subject: [PATCH] fsadm: add support for btrfs Check: mount the device first and then run`btrfs filesystem scrub start -B` command Reisze: find the mount point first and resize the filesystem after get the device id since there are maybe several devices underneath btrfs filesystem --- scripts/fsadm.sh | 74 +++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 71 insertions(+), 3 deletions(-) diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh index 459905f..1219549 100755 --- a/scripts/fsadm.sh +++ b/scripts/fsadm.sh @@ -22,6 +22,7 @@ # ext2/ext3/ext4: resize2fs, tune2fs # reiserfs: resize_reiserfs, reiserfstune # xfs: xfs_growfs, xfs_info +# btrfs: btrfs # # Return values: # 0 success @@ -56,6 +57,7 @@ FSCK=fsck XFS_CHECK=xfs_check # XFS_REPAIR -n is used when XFS_CHECK is not found XFS_REPAIR=xfs_repair +BTRFS=btrfs # user may override lvm location by setting LVM_BINARY LVM=${LVM_BINARY:-lvm} @@ -75,6 +77,9 @@ BLOCKCOUNT= MOUNTPOINT= MOUNTED= REMOUNT= +FINDMNT= +UUID= +BTRFS_DEVID= PROCDIR="/proc" PROCMOUNTS="$PROCDIR/mounts" PROCSELFMOUNTINFO="$PROCDIR/self/mountinfo" @@ -225,6 +230,33 @@ detect_fs() { verbose "\"$FSTYPE\" filesystem found on \"$VOLUME\"." } +check_findmnt() { + FINDMNT=$(which findmnt 2>$NULL) + test -n "$FINDMNT" +} + +detect_fs_uuid() { + UUID=$($BLKID -o value -c $NULL -s UUID "$VOLUME" 2>$NULL) + test -n "$UUID" +} + +#find the mountpoint of this device +detect_mounted_findmnt() { + local TMP + local STR_IFS=$IFS + IFS=" $(echo -n -e '\t')" + + read -r TMP<<EOF +$($FINDMNT -nuP -o TARGET,UUID 2>$NULL | $GREP "$UUID") +EOF + + TMP=${TMP##*TARGET=\"} + TMP=${TMP%%\"*} + MOUNTED=$TMP + test -n "$MOUNTED" + + IFS=$STR_IFS +} # Check that passed mounted MAJOR:MINOR is not matching $MAJOR:MINOR of resized $VOLUME validate_mounted_major_minor() { @@ -352,8 +384,12 @@ detect_mounted_with_proc_mounts() { # check if the given device is already mounted and where # FIXME: resolve swap usage and device stacking -detect_mounted() { - if test -e "$PROCSELFMOUNTINFO"; then +detect_mounted() { + if test "$FSTYPE" = "btrfs" ; then + check_findmnt || error "Need 'findmnt' utility to work with btrfs filesystem" + detect_fs_uuid || verbose "Can't get fs UUID from \"$VOLUME\" volume" + detect_mounted_findmnt + elif test -e "$PROCSELFMOUNTINFO"; then detect_mounted_with_proc_self_mountinfo elif test -e "$PROCMOUNTS"; then detect_mounted_with_proc_mounts @@ -520,6 +556,31 @@ resize_xfs() { fi } +######################## +# Resize btrfs filesystem +# - mounted for upsize/downsize +# - cannot resize when unmounted +######################## +resize_btrfs() { + detect_mounted + MOUNTPOINT=$MOUNTED + if [ -z "$MOUNTED" ]; then + MOUNTPOINT=$TEMPDIR + temp_mount || error "Cannot mount Btrfs filesystem" + fi + + verbose "Parsing $BTRFS filesystem show \"$MOUNTPOINT\"" + for i in $(LC_ALL=C "$BTRFS" filesystem show "$MOUNTPOINT"); do + case "$i" in + *"$VOLUME"*) BTRFS_DEVID=${i##*devid};; + esac + done + BTRFS_DEVID=${BTRFS_DEVID%%size*} + BTRFS_DEVID=$(echo $BTRFS_DEVID|sed 's/^[ \t]*//g'|sed 's/[ \t]*$'//g) + decode_size $1 1 + verbose "Resizing filesystem on device \"$VOLUME\" to $NEWSIZE bytes(btrfs devid: $BTRFS_DEVID) " + dry "$BTRFS" filesystem resize "$BTRFS_DEVID":"$NEWSIZE" "$MOUNTPOINT" +} #################### # Resize filesystem #################### @@ -536,6 +597,7 @@ resize() { "ext3"|"ext2"|"ext4") resize_ext $NEWSIZE ;; "reiserfs") resize_reiser $NEWSIZE ;; "xfs") resize_xfs $NEWSIZE ;; + "btrfs") resize_btrfs $NEWSIZE ;; *) error "Filesystem \"$FSTYPE\" on device \"$VOLUME\" is not supported by this tool." ;; esac || error "Resize $FSTYPE failed." cleanup 0 @@ -593,6 +655,12 @@ check() { # Think about better way.... dry "$XFS_REPAIR" -n -o force_geometry "$VOLUME" fi ;; + "btrfs") #mount the device first and then run scrub + MOUNTPOINT=$TEMPDIR + temp_mount || error "Cannot mount btrfs filesystem" + dry "$BTRFS" scrub start -B "$VOLUME" + test "$MOUNTPOINT" = "$TEMPDIR" && MOUNTPOINT="" temp_umount + ;; *) # check if executed from interactive shell environment case "$-" in *i*) dry "$FSCK" $YES $FORCE "$VOLUME" ;; @@ -614,7 +682,7 @@ test -n "$FSADM_RUNNING" && exit 0 for i in "$TUNE_EXT" "$RESIZE_EXT" "$TUNE_REISER" "$RESIZE_REISER" \ "$TUNE_XFS" "$RESIZE_XFS" "$MOUNT" "$UMOUNT" "$MKDIR" \ "$RMDIR" "$BLOCKDEV" "$BLKID" "$GREP" "$READLINK" \ - "$DATE" "$FSCK" "$XFS_CHECK" "$XFS_REPAIR" "$LVM" ; do + "$DATE" "$FSCK" "$XFS_CHECK" "$XFS_REPAIR" "$LVM" "$BTRFS" ; do test -n "$i" || error "Required command definitions in the script are missing!" done -- 2.10.2