Accepting request 631017 from Base:System

OBS-URL: https://build.opensuse.org/request/show/631017
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/lvm2?expand=0&rev=119
This commit is contained in:
Dominique Leuenberger 2018-08-28 07:23:45 +00:00 committed by Git OBS Bridge
commit 8b24c19aed
17 changed files with 172 additions and 398 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4025a23ec9b15c2cb7486d151c29dc953b75efc4d452cfe9dbbc7c0fac8e80f2
size 2378651

View File

@ -1,7 +0,0 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlo4KccACgkQIoGRwVZ+LBcdSgCg3Dgs6+ItNryJV9GvCCDguOoj
gGQAoIfvtmvZc5eif/P941hGELtZQFZ6
=0j1r
-----END PGP SIGNATURE-----

3
LVM2.2.02.180.tgz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:24997e26dfc916151707c9da504d38d0473bec3481a8230b676bc079041bead6
size 2373004

17
LVM2.2.02.180.tgz.asc Normal file
View File

@ -0,0 +1,17 @@
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)
iQIcBAABAgAGBQJbUMBzAAoJELkRJDHlCQOfksgQAKHvpM0f4Nt354cmY6N+ha7i
ikSv6aYsFHuHYOHFKJLPJBcNaMs3oZxBtVN69ZuV0cdJ7oiwrQzQzy94wvcaBOZy
tWRLVI+grVU7Fp4uyFwGe4kkxUSGK3/lQrhtI8j+drwGvKk7O0dg8k/ayb9N1do5
hx86WsucXDl8EFxCSYGu6D8DaL+5zNhumIBXrjp5IbQunckw1/hRqstfMfs/q7dm
7dLlrCWXuEL6AwHYvSI8BorO2vRX2iUBvovNneooGUnfz+c06VawhgmwMVA3j/Lk
jOyT9ytVAgnI/yvMHKB7RUSbjCHqppvxg0K0Fs3ex2rca+GiSrtXoxsK83xVaqiS
8J3amb46ItLsE+5XUFzsSfFCxAdzEGqdW+/YmgQNRQ0OXHlsg98hTD9zNbhNMIqj
RtlPqzFKdIZfhgRAY3fw2TEAaKkuBG1+AeeJHLrPZFcDOXHyvJqoPYcMb3QeANCx
RhrMNLvs4MKlhXUkeimBJZTKXSCCIwaqtH8rOtYYM9Ei50AQYZddUObVLBoQB01Y
MxC87m1eZgIKipWTNfEXm41M4tLPebkaxT9+IBp38yVcZ1jeXxOk41EXtzcs3PII
/SlUw66qokTgSyXFH+mptqxfB3Xkk8li5wv31yOiVY9MZQzt8fvz/veY5uEGxU/a
1et7yfJMpeJYrMuhtCL4
=kQvz
-----END PGP SIGNATURE-----

View File

@ -1,7 +1,7 @@
Index: LVM2.2.02.177/configure Index: LVM2.2.02.178/configure
=================================================================== ===================================================================
--- LVM2.2.02.177.orig/configure --- LVM2.2.02.178.orig/configure
+++ LVM2.2.02.177/configure +++ LVM2.2.02.178/configure
@@ -10888,8 +10888,6 @@ if [ `expr x"$CLVMD" : '.*corosync.*'` ! @@ -10888,8 +10888,6 @@ if [ `expr x"$CLVMD" : '.*corosync.*'` !
fi fi
@ -20,10 +20,10 @@ Index: LVM2.2.02.177/configure
################################################################################ ################################################################################
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build cluster mirror log daemon" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build cluster mirror log daemon" >&5
$as_echo_n "checking whether to build cluster mirror log daemon... " >&6; } $as_echo_n "checking whether to build cluster mirror log daemon... " >&6; }
Index: LVM2.2.02.177/configure.in Index: LVM2.2.02.178/configure.ac
=================================================================== ===================================================================
--- LVM2.2.02.177.orig/configure.in --- LVM2.2.02.178.orig/configure.ac
+++ LVM2.2.02.177/configure.in +++ LVM2.2.02.178/configure.ac
@@ -959,7 +959,6 @@ fi @@ -959,7 +959,6 @@ fi
################################################################################ ################################################################################

View File

@ -1,34 +0,0 @@
From b8a7f6ba3de6aed38c2969693b6064a943ea8799 Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabelac@redhat.com>
Date: Sun, 8 Jul 2018 21:11:01 +0200
Subject: [PATCH] dev_io: no discard in testmode
When lvm2 command is executed in test mode, discard ioctl is skipped.
This may cause even data-loose in case, issuing discard for released
areas was enabled and user 'tested' lvreduce.
---
lib/device/dev-io.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/device/dev-io.c b/lib/device/dev-io.c
index 145093f17..2a4967fc1 100644
--- a/lib/device/dev-io.c
+++ b/lib/device/dev-io.c
@@ -411,9 +411,11 @@ static int _dev_discard_blocks(struct device *dev, uint64_t offset_bytes, uint64
discard_range[0] = offset_bytes;
discard_range[1] = size_bytes;
- log_debug_devs("Discarding %" PRIu64 " bytes offset %" PRIu64 " bytes on %s.",
- size_bytes, offset_bytes, dev_name(dev));
- if (ioctl(dev->fd, BLKDISCARD, &discard_range) < 0) {
+ log_debug_devs("Discarding %" PRIu64 " bytes offset %" PRIu64 " bytes on %s. %s",
+ size_bytes, offset_bytes, dev_name(dev),
+ test_mode() ? " (test mode - suppressed)" : "");
+
+ if (!test_mode() && ioctl(dev->fd, BLKDISCARD, &discard_range) < 0) {
log_error("%s: BLKDISCARD ioctl at offset %" PRIu64 " size %" PRIu64 " failed: %s.",
dev_name(dev), offset_bytes, size_bytes, strerror(errno));
if (!dev_close(dev))
--
2.12.3

View File

@ -26,14 +26,14 @@ index f152868..f0845d7 100644
--- a/test/Makefile.in --- a/test/Makefile.in
+++ b/test/Makefile.in +++ b/test/Makefile.in
@@ -224,7 +224,7 @@ install: .tests-stamp lib/paths-installed @@ -224,7 +224,7 @@ install: .tests-stamp lib/paths-installed
$(INSTALL_DATA) shell/*.sh $(DATADIR)/shell
$(INSTALL_DATA) api/*.sh $(DATADIR)/api $(INSTALL_DATA) api/*.sh $(DATADIR)/api
$(INSTALL_DATA) unit/*.sh $(DATADIR)/unit
$(INSTALL_DATA) lib/mke2fs.conf $(DATADIR)/lib $(INSTALL_DATA) lib/mke2fs.conf $(DATADIR)/lib
- $(INSTALL_PROGRAM) api/*.{t,py} $(DATADIR)/api - $(INSTALL_PROGRAM) api/*.{t,py} $(DATADIR)/api
+ $(INSTALL_PROGRAM) api/*.py $(DATADIR)/api/ + $(INSTALL_PROGRAM) api/*.py $(DATADIR)/api/
$(INSTALL_PROGRAM) unit/unit-test $(DATADIR)/unit
$(INSTALL_PROGRAM) dbus/*.py $(DATADIR)/dbus/ $(INSTALL_PROGRAM) dbus/*.py $(DATADIR)/dbus/
$(INSTALL_DATA) lib/paths-installed $(DATADIR)/lib/paths $(INSTALL_DATA) lib/paths-installed $(DATADIR)/lib/paths
cd lib && $(INSTALL_DATA) \
@@ -244,6 +244,7 @@ install: .tests-stamp lib/paths-installed @@ -244,6 +244,7 @@ install: .tests-stamp lib/paths-installed
@cd $(EXECDIR) && for i in $(LIB_LINK_NOT); do \ @cd $(EXECDIR) && for i in $(LIB_LINK_NOT); do \
echo "$(LN_S) -f not $$i"; \ echo "$(LN_S) -f not $$i"; \

View File

@ -1,3 +1,36 @@
-------------------------------------------------------------------
Mon Jul 23 11:45:20 UTC 2018 - ghe@suse.com
- Update to LVM2.2.02.180
Never send any discard ioctl with test mode.
Fix thin-pool alloc which needs same PV for data and metadata.
Extend list of non-memlocked areas with newly linked libs.
Enhance vgcfgrestore to check for active LVs in restored VG.
lvconvert: provide possible layouts between linear and striped/raid
Fix unmonitoring of merging snapshots.
Add missing -l description in fsadm man page.
Cache can uses metadata format 2 with cleaner policy.
Avoid showing internal error in lvs output or pvmoved LVs.
Fix check if resized PV can also fit metadata area.
Reopen devices RDWR only before writing to avoid udev issues.
Change pvresize output confusing when no resize took place.
Fix lvmetad hanging on shutdown.
Fix mem leak in clvmd and more coverity issues.
Fix that pvmove does not work (bsc#1080299)
- Drop patches that have been merged upstream
- fate-323203_lvmlockd-add-lockopt-values-for-skipping-selected-lo.patch
- lvm2-69-dm-lvm-metad.rules-explicit-pvscan-rule.patch
- lvm2-69-dm-lvm-metad.rules-set-systemd-vars-on-chang.patch
- bug-1095960_dev_io-no-discard-in-testmode.patch
- Refresh patches
+ bsc1080299-detect-clvm-properly.patch
+ bug-950089_test-fix-lvm2-testsuite-build-error.patch
- Update spec files
Fix BuildRequires package name for modprobe (bsc#1102668)
Fix cmirrord LV creation/activation failure (bsc#1091863)
- Fix building error in OBS due to the script interpreter
+ tests-specify-python3-as-the-script-interpreter.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jul 18 11:33:30 UTC 2018 - ghe@suse.com Wed Jul 18 11:33:30 UTC 2018 - ghe@suse.com

View File

@ -19,8 +19,8 @@
%define libname libdevmapper1_03 %define libname libdevmapper1_03
%define libname_event libdevmapper-event1_03 %define libname_event libdevmapper-event1_03
### COMMON-DEF-BEGIN ### ### COMMON-DEF-BEGIN ###
%define lvm2_version 2.02.177 %define lvm2_version 2.02.180
%define device_mapper_version 1.02.146 %define device_mapper_version 1.02.149
%define thin_provisioning_version 0.7.0 %define thin_provisioning_version 0.7.0
### COMMON-DEF-END ### ### COMMON-DEF-END ###
Name: device-mapper Name: device-mapper
@ -33,7 +33,10 @@ Url: http://www.sourceware.org/lvm2/
Source: ftp://sources.redhat.com/pub/lvm2/LVM2.%{lvm2_version}.tgz Source: ftp://sources.redhat.com/pub/lvm2/LVM2.%{lvm2_version}.tgz
Source1: ftp://sources.redhat.com/pub/lvm2/LVM2.%{lvm2_version}.tgz.asc Source1: ftp://sources.redhat.com/pub/lvm2/LVM2.%{lvm2_version}.tgz.asc
Source99: baselibs.conf Source99: baselibs.conf
# To detect modprobe during build
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: kmod-compat
BuildRequires: libaio-devel
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: suse-module-tools BuildRequires: suse-module-tools
BuildRequires: thin-provisioning-tools >= %{thin_provisioning_version} BuildRequires: thin-provisioning-tools >= %{thin_provisioning_version}
@ -47,8 +50,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
%{?systemd_requires} %{?systemd_requires}
### COMMON-PATCH-BEGIN ### ### COMMON-PATCH-BEGIN ###
# Upstream patches # Upstream patches
Patch0001: fate-323203_lvmlockd-add-lockopt-values-for-skipping-selected-lo.patch
Patch0002: bug-1095960_dev_io-no-discard-in-testmode.patch
# SUSE patches: 1000+ for LVM # SUSE patches: 1000+ for LVM
# Never upstream # Never upstream
@ -60,8 +61,6 @@ Patch1005: bsc1080299-detect-clvm-properly.patch
#SUSE patches 2000+ for device mapper, udev rules #SUSE patches 2000+ for device mapper, udev rules
Patch2001: bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch Patch2001: bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch
Patch2002: lvm2-69-dm-lvm-metad.rules-explicit-pvscan-rule.patch
Patch2003: lvm2-69-dm-lvm-metad.rules-set-systemd-vars-on-chang.patch
### COMMON-PATCH-END ### ### COMMON-PATCH-END ###
%description %description
@ -71,15 +70,11 @@ Programs and man pages for configuring and using the device mapper.
%setup -q -n LVM2.%{lvm2_version} %setup -q -n LVM2.%{lvm2_version}
### COMMON-PREP-BEGIN ### ### COMMON-PREP-BEGIN ###
%patch1001 -p1 %patch1001 -p1
%patch0001 -p1
%patch0002 -p1
%patch1002 -p1 %patch1002 -p1
%patch1003 -p1 %patch1003 -p1
%patch1004 -p1 %patch1004 -p1
%patch1005 -p1 %patch1005 -p1
%patch2001 -p1 %patch2001 -p1
%patch2002 -p1
%patch2003 -p1
### COMMON-PREP-END ### ### COMMON-PREP-END ###
%build %build

View File

@ -1,79 +0,0 @@
From 46cedb105bb7fdba0107794ca5801c2a0e8fd524 Mon Sep 17 00:00:00 2001
From: David Teigland <teigland@redhat.com>
Date: Tue, 9 Jan 2018 11:18:57 -0600
Subject: [PATCH 1/2] lvmlockd: add lockopt values for skipping selected locks
and add lockopt to common options.
---
tools/command-lines.in | 9 ++++-----
tools/lvmcmdline.c | 10 ++++++++++
2 files changed, 14 insertions(+), 5 deletions(-)
diff --git a/tools/command-lines.in b/tools/command-lines.in
index d0e5e060c..a1776ce8a 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -187,7 +187,7 @@
# OO_ALL is included in every command automatically.
#
OO_ALL: --commandprofile String, --config String, --debug,
---driverloaded Bool, --help, --longhelp, --profile String, --quiet,
+--driverloaded Bool, --help, --lockopt String, --longhelp, --profile String, --quiet,
--verbose, --version, --yes, --test
#
@@ -1524,19 +1524,18 @@ ID: vgchange_systemid
DESC: Change the system ID of a VG.
vgchange --lockstart
-OO: --lockopt String, --select String
+OO: --select String
OP: VG|Tag|Select ...
ID: vgchange_lockstart
DESC: Start the lockspace of a shared VG in lvmlockd.
vgchange --lockstop
-OO: --lockopt String, --select String
+OO: --select String
OP: VG|Tag|Select ...
ID: vgchange_lockstop
DESC: Stop the lockspace of a shared VG in lvmlockd.
vgchange --locktype LockType VG
-OO: --lockopt String
ID: vgchange_locktype
DESC: Change the lock type for a shared VG.
@@ -1563,7 +1562,7 @@ OO: --addtag Tag, --alloc Alloc, --autobackup Bool, --clustered Bool, --maxlogic
--physicalextentsize SizeMB, --force, --zero Bool, --labelsector Number,
--metadatasize SizeMB, --pvmetadatacopies MetadataCopiesPV, --vgmetadatacopies MetadataCopiesVG,
--reportformat ReportFmt, --dataalignment SizeKB, --dataalignmentoffset SizeKB,
---shared, --systemid String, --locktype LockType, --lockopt String
+--shared, --systemid String, --locktype LockType
ID: vgcreate_general
---
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index b693722c1..791e27206 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -2682,6 +2682,16 @@ static int _init_lvmlockd(struct cmd_context *cmd)
return 1;
}
+ if (use_lvmlockd && arg_is_set(cmd, lockopt_ARG)) {
+ const char *opts = arg_str_value(cmd, lockopt_ARG, "");
+ if (strstr(opts, "skiplv"))
+ cmd->lockd_lv_disable = 1;
+ if (strstr(opts, "skipvg"))
+ cmd->lockd_vg_disable = 1;
+ if (strstr(opts, "skipgl"))
+ cmd->lockd_gl_disable = 1;
+ }
+
if (use_lvmlockd && locking_is_clustered()) {
log_error("ERROR: configuration setting use_lvmlockd cannot be used with clustered locking_type 3.");
return 0;
--
2.13.6

View File

@ -1,83 +0,0 @@
From fe1af8d113e8b0f5a8aa9397b05eb00341aea332 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Thu, 21 Dec 2017 09:30:16 +0100
Subject: [PATCH 1/2] lvm2: 69-dm-lvm-metad.rules: explicit pvscan rule
Make the distinction between the cases with and without systemd
background jobs explicit in 69-dm-lvm-metad.rules rather than
substituting the rule from the Makefile. At this stage,
this improves only readibility, at the cost of one GOTO statement.
The next patch will add more differences between the two cases (mostly
comments), which are practically impossible to generate with the current
string subsitution approach.
This patch introduces no functional change to the udev rules.
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
udev/69-dm-lvm-metad.rules.in | 19 ++++++++++++++++++-
udev/Makefile.in | 9 +++++----
2 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in
index fff063f6dafd..e8d9a64c29f5 100644
--- a/udev/69-dm-lvm-metad.rules.in
+++ b/udev/69-dm-lvm-metad.rules.in
@@ -88,6 +88,23 @@ LABEL="lvm_scan"
# loop | | X | X* | |
# other | X | | X | | X
ENV{SYSTEMD_READY}="1"
-(PVSCAN_RULE)
+
+# The method for invoking pvscan is selected at build time with the option
+# --(enable|disable)-udev-systemd-background-jobs to "configure".
+# On modern distributions with recent systemd, it's "systemd_background";
+# on others, "direct_pvscan".
+GOTO="(PVSCAN_RULE)"
+
+LABEL="systemd_background"
+
+ACTION!="remove", ENV{LVM_PV_GONE}=="1", RUN+="(BINDIR)/systemd-run (LVM_EXEC)/lvm pvscan --cache $major:$minor", GOTO="lvm_end"
+ENV{SYSTEMD_ALIAS}="/dev/block/$major:$minor"
+ENV{ID_MODEL}="LVM PV $env{ID_FS_UUID_ENC} on /dev/$name"
+ENV{SYSTEMD_WANTS}+="lvm2-pvscan@$major:$minor.service"
+GOTO="lvm_end"
+
+LABEL="direct_pvscan"
+
+RUN+="(LVM_EXEC)/lvm pvscan --background --cache --activate ay --major $major --minor $minor", ENV{LVM_SCANNED}="1"
LABEL="lvm_end"
diff --git a/udev/Makefile.in b/udev/Makefile.in
index cd031aefa084..5797ee699b95 100644
--- a/udev/Makefile.in
+++ b/udev/Makefile.in
@@ -26,6 +26,7 @@ endif
DM_DIR=$(shell $(GREP) "\#define DM_DIR" $(top_srcdir)/libdm/misc/dm-ioctl.h | $(AWK) '{print $$3}')
+BINDIR=@bindir@
ifeq ("@UDEV_RULE_EXEC_DETECTION@", "yes")
SBIN=\$$env{DM_SBIN_PATH}
DM_EXEC_RULE=ENV{DM_SBIN_PATH}=\"\/sbin\"\\nTEST!=\"\$$env{DM_SBIN_PATH}\/dmsetup\", ENV{DM_SBIN_PATH}=\"\/usr\/sbin\"
@@ -47,13 +48,13 @@ BLKID_RULE=IMPORT{program}=\"${SBIN}\/blkid -o udev -p \$$tempnode\"
endif
ifeq ("@UDEV_SYSTEMD_BACKGROUND_JOBS@", "yes")
-PVSCAN_RULE=ACTION\!=\"remove\", ENV{LVM_PV_GONE}==\"1\", RUN\+=\"@bindir@/systemd-run $(LVM_EXEC)\/lvm pvscan --cache \$$major\:\$$minor\", GOTO=\"lvm_end\"\nENV{SYSTEMD_ALIAS}=\"\/dev\/block\/\$$major:\$$minor\"\nENV{ID_MODEL}=\"LVM PV \$$env{ID_FS_UUID_ENC} on \/dev\/\$$name\"\nENV{SYSTEMD_WANTS}\+=\"lvm2-pvscan@\$$major:\$$minor.service\"
+PVSCAN_RULE=systemd_background
else
-PVSCAN_RULE=RUN\+\=\"$(LVM_EXEC)/lvm pvscan --background --cache --activate ay --major \$$major --minor \$$minor\", ENV{LVM_SCANNED}=\"1\"
+PVSCAN_RULE=direct_pvscan
endif
%.rules: $(srcdir)/%.rules.in
- $(SED) -e "s+(DM_DIR)+$(DM_DIR)+;s+(BLKID_RULE)+$(BLKID_RULE)+;s+(PVSCAN_RULE)+$(PVSCAN_RULE)+;s+(DM_EXEC_RULE)+$(DM_EXEC_RULE)+;s+(DM_EXEC)+$(DM_EXEC)+;s+(LVM_EXEC_RULE)+$(LVM_EXEC_RULE)+;s+(LVM_EXEC)+$(LVM_EXEC)+;" $< >$@
+ $(SED) -e "s+(DM_DIR)+$(DM_DIR)+;s+(BINDIR)+$(BINDIR)+;s+(BLKID_RULE)+$(BLKID_RULE)+;s+(PVSCAN_RULE)+$(PVSCAN_RULE)+;s+(DM_EXEC_RULE)+$(DM_EXEC_RULE)+;s+(DM_EXEC)+$(DM_EXEC)+;s+(LVM_EXEC_RULE)+$(LVM_EXEC_RULE)+;s+(LVM_EXEC)+$(LVM_EXEC)+;" $< >$@
%_install: %.rules
$(INSTALL_DATA) -D $< $(udevdir)/$(<F)
--
2.15.1

View File

@ -1,153 +0,0 @@
From b822179c5181b52f9a84e7dde27e19a5bed19896 Mon Sep 17 00:00:00 2001
From: Martin Wilck <mwilck@suse.com>
Date: Thu, 21 Dec 2017 10:06:38 +0100
Subject: [PATCH 2/2] lvm2: 69-dm-lvm-metad.rules: set systemd vars on "change"
The current logic that avoids setting SYSTEMD_ALIAS and SYSTEMD_WANTS
on "change" events is flawed in the default "systemd background job"
configuration. For systemd, it's important that device properties don't
change spuriously.
If an "add" event starts lvm2-pvscan@.service for a device, and a
"change" event follows, removing SYSTEMD_ALIAS and SYSTEMD_WANTS from the
udev db, information about unit dependencies between the device and the
pvscan service can be lost in systemd, in particular if the daemon
configuration is reloaded.
Steps to reproduce problem:
- create a device with an LVM PV
- remove device
- add device (generates "add" and "change" uevents for the device)
(at this point SYSTEMD_ALIAS and SYSTEMD_WANTS are clear in udev db)
- systemctl daemon-reload
(systemd reloads udev db)
- vgchange -a n
- remove device
=> the lvm2-pvscan@.service for the device is still active although the
device is gone.
- add device again
=> the PV is not detected, because systemd sees the lvm2-pvscan@.service
as active and thus doesn't restart it.
The original purpose of this logic was to avoid volumes being scanned
over and over again. With systemd background jobs, that isn't necessary,
because systemd will not restart the job as long as it's active.
Signed-off-by: Martin Wilck <mwilck@suse.com>
---
udev/69-dm-lvm-metad.rules.in | 56 +++++++++++++++++++++++++++++++------------
udev/Makefile.in | 4 +++-
2 files changed, 44 insertions(+), 16 deletions(-)
diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in
index e8d9a64c29f5..203cb479f592 100644
--- a/udev/69-dm-lvm-metad.rules.in
+++ b/udev/69-dm-lvm-metad.rules.in
@@ -68,25 +68,15 @@ ACTION=="change", ENV{LVM_LOOP_PV_ACTIVATED}!="1", TEST=="loop/backing_file", EN
ENV{LVM_LOOP_PV_ACTIVATED}!="1", ENV{SYSTEMD_READY}="0"
GOTO="lvm_end"
-# If the PV is not a special device listed above, scan only after device addition (ADD event)
+# If the PV is not a special device listed above, scan only if necessary.
+# For "direct_pvscan" mode (see below), this means run rules only an ADD events.
+# For "systemd_background" mode, systemd takes care of this by activating
+# the lvm2-pvscan@.service only once.
LABEL="next"
-ACTION!="add", GOTO="lvm_end"
+ACTION!="(PVSCAN_ACTION)", GOTO="lvm_end"
LABEL="lvm_scan"
-# The table below summarises the situations in which we reach the LABEL="lvm_scan".
-# Marked by X, X* means only if the special dev is properly set up.
-# The artificial ADD is supported for coldplugging. We avoid running the pvscan
-# on artificial CHANGE so there's no unexpected autoactivation when WATCH rule fires.
-# N.B. MD and loop never actually reaches lvm_scan on REMOVE as the PV label is gone
-# within a CHANGE event (these are caught by the "LVM_PV_GONE" rule at the beginning).
-#
-# | real ADD | real CHANGE | artificial ADD | artificial CHANGE | REMOVE
-# =============================================================================
-# DM | | X | X* | | X
-# MD | | X | X* | |
-# loop | | X | X* | |
-# other | X | | X | | X
ENV{SYSTEMD_READY}="1"
# The method for invoking pvscan is selected at build time with the option
@@ -97,6 +87,27 @@ GOTO="(PVSCAN_RULE)"
LABEL="systemd_background"
+# The table below summarises the situations in which we reach the LABEL="lvm_scan"
+# in the "systemd_background" case.
+# Marked by X, X* means only if the special dev is properly set up.
+# The artificial ADD is supported for coldplugging. We avoid running the pvscan
+# on artificial CHANGE so there's no unexpected autoactivation when WATCH rule fires.
+# N.B. MD and loop never actually reaches lvm_scan on REMOVE as the PV label is gone
+# within a CHANGE event (these are caught by the "LVM_PV_GONE" rule at the beginning).
+#
+# In this case, we simply set up the dependency between the device and the pvscan
+# job using SYSTEMD_ALIAS (which sets up a simplified device identifier that
+# allows using "BindsTo" in the sytemd unit file) and SYSTEMD_WANTS (which tells
+# systemd to start the pvscan job once the device is ready).
+# We need to set these variables for both "add" and "change" events, otherwise
+# systemd may loose information about the device/unit dependencies.
+#
+# | real ADD | real CHANGE | artificial ADD | artificial CHANGE | REMOVE
+# =============================================================================
+# DM | | X | X* | | X
+# MD | | X | X* | |
+# loop | | X | X* | |
+# other | X | X | X | | X
ACTION!="remove", ENV{LVM_PV_GONE}=="1", RUN+="(BINDIR)/systemd-run (LVM_EXEC)/lvm pvscan --cache $major:$minor", GOTO="lvm_end"
ENV{SYSTEMD_ALIAS}="/dev/block/$major:$minor"
ENV{ID_MODEL}="LVM PV $env{ID_FS_UUID_ENC} on /dev/$name"
@@ -105,6 +116,21 @@ GOTO="lvm_end"
LABEL="direct_pvscan"
+# The table below summarises the situations in which we reach the LABEL="lvm_scan"
+# for the "direct_pvscan" case.
+# Marked by X, X* means only if the special dev is properly set up.
+# The artificial ADD is supported for coldplugging. We avoid running the pvscan
+# on artificial CHANGE so there's no unexpected autoactivation when WATCH rule fires.
+#
+# In this case, we need to make sure that pvscan is not invoked spuriously, therefore
+# we invoke it only for "add" events for "other" devices.
+#
+# | real ADD | real CHANGE | artificial ADD | artificial CHANGE | REMOVE
+# =============================================================================
+# DM | | X | X* | | X
+# MD | | X | X* | |
+# loop | | X | X* | |
+# other | X | | X | | X
RUN+="(LVM_EXEC)/lvm pvscan --background --cache --activate ay --major $major --minor $minor", ENV{LVM_SCANNED}="1"
LABEL="lvm_end"
diff --git a/udev/Makefile.in b/udev/Makefile.in
index 5797ee699b95..3e274736d145 100644
--- a/udev/Makefile.in
+++ b/udev/Makefile.in
@@ -49,12 +49,14 @@ endif
ifeq ("@UDEV_SYSTEMD_BACKGROUND_JOBS@", "yes")
PVSCAN_RULE=systemd_background
+PVSCAN_ACTION=add|change
else
PVSCAN_RULE=direct_pvscan
+PVSCAN_ACTION=add
endif
%.rules: $(srcdir)/%.rules.in
- $(SED) -e "s+(DM_DIR)+$(DM_DIR)+;s+(BINDIR)+$(BINDIR)+;s+(BLKID_RULE)+$(BLKID_RULE)+;s+(PVSCAN_RULE)+$(PVSCAN_RULE)+;s+(DM_EXEC_RULE)+$(DM_EXEC_RULE)+;s+(DM_EXEC)+$(DM_EXEC)+;s+(LVM_EXEC_RULE)+$(LVM_EXEC_RULE)+;s+(LVM_EXEC)+$(LVM_EXEC)+;" $< >$@
+ $(SED) -e "s+(DM_DIR)+$(DM_DIR)+;s+(BINDIR)+$(BINDIR)+;s+(BLKID_RULE)+$(BLKID_RULE)+;s+(PVSCAN_RULE)+$(PVSCAN_RULE)+;s+(PVSCAN_ACTION)+$(PVSCAN_ACTION)+;s+(DM_EXEC_RULE)+$(DM_EXEC_RULE)+;s+(DM_EXEC)+$(DM_EXEC)+;s+(LVM_EXEC_RULE)+$(LVM_EXEC_RULE)+;s+(LVM_EXEC)+$(LVM_EXEC)+;" $< >$@
%_install: %.rules
$(INSTALL_DATA) -D $< $(udevdir)/$(<F)
--
2.15.1

View File

@ -1,3 +1,36 @@
-------------------------------------------------------------------
Mon Jul 23 11:45:20 UTC 2018 - ghe@suse.com
- Update to LVM2.2.02.180
Never send any discard ioctl with test mode.
Fix thin-pool alloc which needs same PV for data and metadata.
Extend list of non-memlocked areas with newly linked libs.
Enhance vgcfgrestore to check for active LVs in restored VG.
lvconvert: provide possible layouts between linear and striped/raid
Fix unmonitoring of merging snapshots.
Add missing -l description in fsadm man page.
Cache can uses metadata format 2 with cleaner policy.
Avoid showing internal error in lvs output or pvmoved LVs.
Fix check if resized PV can also fit metadata area.
Reopen devices RDWR only before writing to avoid udev issues.
Change pvresize output confusing when no resize took place.
Fix lvmetad hanging on shutdown.
Fix mem leak in clvmd and more coverity issues.
Fix that pvmove does not work (bsc#1080299)
- Drop patches that have been merged upstream
- fate-323203_lvmlockd-add-lockopt-values-for-skipping-selected-lo.patch
- lvm2-69-dm-lvm-metad.rules-explicit-pvscan-rule.patch
- lvm2-69-dm-lvm-metad.rules-set-systemd-vars-on-chang.patch
- bug-1095960_dev_io-no-discard-in-testmode.patch
- Refresh patches
+ bsc1080299-detect-clvm-properly.patch
+ bug-950089_test-fix-lvm2-testsuite-build-error.patch
- Update spec files
Fix BuildRequires package name for modprobe (bsc#1102668)
Fix cmirrord LV creation/activation failure (bsc#1091863)
- Fix building error in OBS due to the script interpreter
+ tests-specify-python3-as-the-script-interpreter.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jul 18 11:33:30 UTC 2018 - ghe@suse.com Wed Jul 18 11:33:30 UTC 2018 - ghe@suse.com

View File

@ -19,8 +19,8 @@
%define dlm_version 3.99.1 %define dlm_version 3.99.1
%define sanlock_version 3.3.0 %define sanlock_version 3.3.0
### COMMON-DEF-BEGIN ### ### COMMON-DEF-BEGIN ###
%define lvm2_version 2.02.177 %define lvm2_version 2.02.180
%define device_mapper_version 1.02.146 %define device_mapper_version 1.02.149
%define thin_provisioning_version 0.7.0 %define thin_provisioning_version 0.7.0
### COMMON-DEF-END ### ### COMMON-DEF-END ###
Name: lvm2-clvm Name: lvm2-clvm
@ -32,6 +32,9 @@ Group: Productivity/Clustering/HA
Url: http://sources.redhat.com/cluster/clvm/ Url: http://sources.redhat.com/cluster/clvm/
Source: ftp://sources.redhat.com/pub/lvm2/LVM2.%{lvm2_version}.tgz Source: ftp://sources.redhat.com/pub/lvm2/LVM2.%{lvm2_version}.tgz
Source1: ftp://sources.redhat.com/pub/lvm2/LVM2.%{lvm2_version}.tgz.asc Source1: ftp://sources.redhat.com/pub/lvm2/LVM2.%{lvm2_version}.tgz.asc
# To detect modprobe during build
BuildRequires: kmod-compat
BuildRequires: libaio-devel
BuildRequires: libcorosync-devel BuildRequires: libcorosync-devel
BuildRequires: libdlm-devel >= %{dlm_version} BuildRequires: libdlm-devel >= %{dlm_version}
BuildRequires: pkgconfig BuildRequires: pkgconfig
@ -48,8 +51,6 @@ Obsoletes: cmirrord < %{version}
Provides: cmirrord = %{version} Provides: cmirrord = %{version}
### COMMON-PATCH-BEGIN ### ### COMMON-PATCH-BEGIN ###
# Upstream patches # Upstream patches
Patch0001: fate-323203_lvmlockd-add-lockopt-values-for-skipping-selected-lo.patch
Patch0002: bug-1095960_dev_io-no-discard-in-testmode.patch
# SUSE patches: 1000+ for LVM # SUSE patches: 1000+ for LVM
# Never upstream # Never upstream
@ -61,8 +62,6 @@ Patch1005: bsc1080299-detect-clvm-properly.patch
#SUSE patches 2000+ for device mapper, udev rules #SUSE patches 2000+ for device mapper, udev rules
Patch2001: bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch Patch2001: bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch
Patch2002: lvm2-69-dm-lvm-metad.rules-explicit-pvscan-rule.patch
Patch2003: lvm2-69-dm-lvm-metad.rules-set-systemd-vars-on-chang.patch
### COMMON-PATCH-END ### ### COMMON-PATCH-END ###
# Patches for clvmd and cmirrord # Patches for clvmd and cmirrord
@ -76,15 +75,11 @@ A daemon for using LVM2 Logival Volumes in a clustered environment.
### COMMON-PREP-BEGIN ### ### COMMON-PREP-BEGIN ###
%patch1001 -p1 %patch1001 -p1
%patch0001 -p1
%patch0002 -p1
%patch1002 -p1 %patch1002 -p1
%patch1003 -p1 %patch1003 -p1
%patch1004 -p1 %patch1004 -p1
%patch1005 -p1 %patch1005 -p1
%patch2001 -p1 %patch2001 -p1
%patch2002 -p1
%patch2003 -p1
### COMMON-PREP-END ### ### COMMON-PREP-END ###
%patch3001 -p1 %patch3001 -p1

View File

@ -1,3 +1,36 @@
-------------------------------------------------------------------
Mon Jul 23 11:45:20 UTC 2018 - ghe@suse.com
- Update to LVM2.2.02.180
Never send any discard ioctl with test mode.
Fix thin-pool alloc which needs same PV for data and metadata.
Extend list of non-memlocked areas with newly linked libs.
Enhance vgcfgrestore to check for active LVs in restored VG.
lvconvert: provide possible layouts between linear and striped/raid
Fix unmonitoring of merging snapshots.
Add missing -l description in fsadm man page.
Cache can uses metadata format 2 with cleaner policy.
Avoid showing internal error in lvs output or pvmoved LVs.
Fix check if resized PV can also fit metadata area.
Reopen devices RDWR only before writing to avoid udev issues.
Change pvresize output confusing when no resize took place.
Fix lvmetad hanging on shutdown.
Fix mem leak in clvmd and more coverity issues.
Fix that pvmove does not work (bsc#1080299)
- Drop patches that have been merged upstream
- fate-323203_lvmlockd-add-lockopt-values-for-skipping-selected-lo.patch
- lvm2-69-dm-lvm-metad.rules-explicit-pvscan-rule.patch
- lvm2-69-dm-lvm-metad.rules-set-systemd-vars-on-chang.patch
- bug-1095960_dev_io-no-discard-in-testmode.patch
- Refresh patches
+ bsc1080299-detect-clvm-properly.patch
+ bug-950089_test-fix-lvm2-testsuite-build-error.patch
- Update spec files
Fix BuildRequires package name for modprobe (bsc#1102668)
Fix cmirrord LV creation/activation failure (bsc#1091863)
- Fix building error in OBS due to the script interpreter
+ tests-specify-python3-as-the-script-interpreter.patch
------------------------------------------------------------------- -------------------------------------------------------------------
Wed Jul 18 11:33:30 UTC 2018 - ghe@suse.com Wed Jul 18 11:33:30 UTC 2018 - ghe@suse.com

View File

@ -16,13 +16,14 @@
# #
%define _unpackaged_files_terminate_build 0
%define _udevdir %(pkg-config --variable=udevdir udev) %define _udevdir %(pkg-config --variable=udevdir udev)
%define applib liblvm2app2_2 %define applib liblvm2app2_2
%define cmdlib liblvm2cmd2_02 %define cmdlib liblvm2cmd2_02
### COMMON-DEF-BEGIN ### ### COMMON-DEF-BEGIN ###
%define lvm2_version 2.02.177 %define lvm2_version 2.02.180
%define device_mapper_version 1.02.146 %define device_mapper_version 1.02.149
%define thin_provisioning_version 0.7.0 %define thin_provisioning_version 0.7.0
### COMMON-DEF-END ### ### COMMON-DEF-END ###
@ -38,9 +39,10 @@ Source1: lvm.conf
Source42: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz.asc Source42: ftp://sources.redhat.com/pub/lvm2/LVM2.%{version}.tgz.asc
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: libaio-devel BuildRequires: libaio-devel
BuildRequires: libcorosync-devel
BuildRequires: libselinux-devel BuildRequires: libselinux-devel
# To detect modprobe during build # To detect modprobe during build
BuildRequires: modutils BuildRequires: kmod-compat
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: readline-devel BuildRequires: readline-devel
BuildRequires: thin-provisioning-tools >= %{thin_provisioning_version} BuildRequires: thin-provisioning-tools >= %{thin_provisioning_version}
@ -58,8 +60,6 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
### COMMON-PATCH-BEGIN ### ### COMMON-PATCH-BEGIN ###
# Upstream patches # Upstream patches
Patch0001: fate-323203_lvmlockd-add-lockopt-values-for-skipping-selected-lo.patch
Patch0002: bug-1095960_dev_io-no-discard-in-testmode.patch
# SUSE patches: 1000+ for LVM # SUSE patches: 1000+ for LVM
# Never upstream # Never upstream
@ -71,14 +71,13 @@ Patch1005: bsc1080299-detect-clvm-properly.patch
#SUSE patches 2000+ for device mapper, udev rules #SUSE patches 2000+ for device mapper, udev rules
Patch2001: bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch Patch2001: bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch
Patch2002: lvm2-69-dm-lvm-metad.rules-explicit-pvscan-rule.patch
Patch2003: lvm2-69-dm-lvm-metad.rules-set-systemd-vars-on-chang.patch
### COMMON-PATCH-END ### ### COMMON-PATCH-END ###
# 3000+ for test code # 3000+ for test code
Patch3001: bug-950089_test-fix-lvm2-testsuite-build-error.patch Patch3001: bug-950089_test-fix-lvm2-testsuite-build-error.patch
Patch3002: bug-1043040_test-fix-read-ahead-issues-in-test-scripts.patch Patch3002: bug-1043040_test-fix-read-ahead-issues-in-test-scripts.patch
Patch3003: bug-1072624_test-lvmetad_dump-always-timed-out-when-using-nc.patch Patch3003: bug-1072624_test-lvmetad_dump-always-timed-out-when-using-nc.patch
Patch3004: tests-specify-python3-as-the-script-interpreter.patch
# patches specif for lvm2.spec # patches specif for lvm2.spec
Patch4001: bug-1037309_Makefile-skip-compliling-daemons-lvmlockd-directory.patch Patch4001: bug-1037309_Makefile-skip-compliling-daemons-lvmlockd-directory.patch
@ -91,20 +90,17 @@ Volume Manager.
%setup -q -n LVM2.%{version} %setup -q -n LVM2.%{version}
### COMMON-PREP-BEGIN ### ### COMMON-PREP-BEGIN ###
%patch1001 -p1 %patch1001 -p1
%patch0001 -p1
%patch0002 -p1
%patch1002 -p1 %patch1002 -p1
%patch1003 -p1 %patch1003 -p1
%patch1004 -p1 %patch1004 -p1
%patch1005 -p1 %patch1005 -p1
%patch2001 -p1 %patch2001 -p1
%patch2002 -p1
%patch2003 -p1
### COMMON-PREP-END ### ### COMMON-PREP-END ###
%patch3001 -p1 %patch3001 -p1
%patch3002 -p1 %patch3002 -p1
%patch3003 -p1 %patch3003 -p1
%patch3004 -p1
%patch4001 -p1 %patch4001 -p1
%build %build
@ -119,6 +115,7 @@ extra_opts="
--with-default-locking-dir=/run/lock/lvm --with-default-locking-dir=/run/lock/lvm
--with-default-pid-dir=/run --with-default-pid-dir=/run
--with-default-run-dir=/run/lvm --with-default-run-dir=/run/lvm
--enable-cmirrord
" "
### COMMON-CONFIG-BEGIN ### ### COMMON-CONFIG-BEGIN ###

View File

@ -0,0 +1,27 @@
From 3f768d29ceb5427b6e8de4fe35e2c1001409d750 Mon Sep 17 00:00:00 2001
From: Gang He <ghe@suse.com>
Date: Wed, 20 Jun 2018 14:04:52 +0800
Subject: [PATCH] tests: specify python3 as the script interpreter
specify /usr/bin/python3 as the script interpreter in
python_lvm_unit.py.in file, otherwise, there will be a building
error in OBS.
Signed-off-by: Gang He <ghe@suse.com>
---
test/api/python_lvm_unit.py.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/api/python_lvm_unit.py.in b/test/api/python_lvm_unit.py.in
index 78ced7e31..c6a7c9905 100755
--- a/test/api/python_lvm_unit.py.in
+++ b/test/api/python_lvm_unit.py.in
@@ -1,4 +1,4 @@
-#!@PYTHON@
+#!/usr/bin/python3
# Copyright (C) 2012-2013 Red Hat, Inc. All rights reserved.
#
--
2.12.3