Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fa0a04236c613fb82e3cd…
Commit: fa0a04236c613fb82e3cd559c6b451f5eb7102ad
Parent: bfcecbbce182570d040f3ec446dccb84ca07efcd
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Aug 30 09:54:02 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Aug 30 10:00:36 2018 -0500
tests: add scan-lvs
---
test/shell/scan-lvs.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 47 insertions(+), 0 deletions(-)
diff --git a/test/shell/scan-lvs.sh b/test/shell/scan-lvs.sh
new file mode 100644
index 0000000..8e8a77d
--- /dev/null
+++ b/test/shell/scan-lvs.sh
@@ -0,0 +1,47 @@
+#!/bin/bash
+# Copyright (C) 2014 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Test scan_lvs config setting
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux extend_filter_LVMTEST
+
+aux lvmconf 'devices/scan_lvs = 1'
+
+aux prepare_pvs 1
+
+vgcreate $SHARED $vg1 "$dev1"
+
+lvcreate -l1 -n $lv1 $vg1
+
+pvcreate "$DM_DEV_DIR/$vg1/$lv1"
+
+pvs "$DM_DEV_DIR/$vg1/$lv1"
+
+aux lvmconf 'devices/scan_lvs = 0'
+
+not pvs "$DM_DEV_DIR/$vg1/$lv1"
+
+pvs --config devices/scan_lvs=1 "$DM_DEV_DIR/$vg1/$lv1"
+
+not pvremove "$DM_DEV_DIR/$vg1/$lv1"
+
+pvremove --config devices/scan_lvs=1 "$DM_DEV_DIR/$vg1/$lv1"
+
+lvchange -an "$vg1/$lv1"
+
+lvremove "$vg1/$lv1"
+
+vgremove $vg1
+
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=cb17ef221bdefea3625a2…
Commit: cb17ef221bdefea3625a22c19c6d8f5504441771
Parent: fade9ca3b6ee1432ae8c2878815bbf871cacf92d
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Thu Aug 30 12:35:58 2018 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Thu Aug 30 12:35:58 2018 +0200
scripts: add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service
We need to have Ceph RBD devices mapped first before use in a stack
where LVM is on top so make sure rbdmap.service is called before
generated lvm2-activation-net.service.
On shutdown, we need to stop blk-availability first before we stop the
rbdmap.service.
Resolves: rhbz1623479
---
WHATS_NEW | 1 +
.../blk_availability_systemd_red_hat.service.in | 2 +-
.../lvm2_activation_generator_systemd_red_hat.c | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index bf03c49..8489252 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 3.0.0
=============
+ Add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service.
Reduce max concurrent aios to avoid EMFILE with many devices.
Fix lvconvert conversion attempts to linear.
Fix lvconvert raid0/raid0_meta -> striped regression.
diff --git a/scripts/blk_availability_systemd_red_hat.service.in b/scripts/blk_availability_systemd_red_hat.service.in
index 1198baa..9462072 100644
--- a/scripts/blk_availability_systemd_red_hat.service.in
+++ b/scripts/blk_availability_systemd_red_hat.service.in
@@ -1,6 +1,6 @@
[Unit]
Description=Availability of block devices
-After=lvm2-activation.service lvm2-lvmetad.service iscsi-shutdown.service iscsi.service iscsid.service fcoe.service
+After=lvm2-activation.service lvm2-lvmetad.service iscsi-shutdown.service iscsi.service iscsid.service fcoe.service rbdmap.service
DefaultDependencies=no
Conflicts=shutdown.target
diff --git a/scripts/lvm2_activation_generator_systemd_red_hat.c b/scripts/lvm2_activation_generator_systemd_red_hat.c
index b3d18d2..b751841 100644
--- a/scripts/lvm2_activation_generator_systemd_red_hat.c
+++ b/scripts/lvm2_activation_generator_systemd_red_hat.c
@@ -160,7 +160,7 @@ static int generate_unit(struct generator *gen, int unit)
"SourcePath=/etc/lvm/lvm.conf\n" "DefaultDependencies=no\n", f);
if (unit == UNIT_NET) {
- fprintf(f, "After=%s iscsi.service fcoe.service\n"
+ fprintf(f, "After=%s iscsi.service fcoe.service rbdmap.service\n"
"Before=remote-fs-pre.target shutdown.target\n\n"
"[Service]\n"
"ExecStartPre=/usr/bin/udevadm settle\n", _unit_names[UNIT_MAIN]);
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fade9ca3b6ee1432ae8c2…
Commit: fade9ca3b6ee1432ae8c2878815bbf871cacf92d
Parent: 3c966e637fe1bec587ceb9ad13aa009db64b4f8e
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Fri Aug 24 14:46:51 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Fri Aug 24 14:55:12 2018 -0500
bcache: reduce MAX_IO to 256
This is the number of concurrent async io requests that
the scan layer will submit to the bcache layer. There
will be an open fd for each of these, so it is best to
keep this well below the default limit for max open files
(1024), otherwise lvm may get EMFILE from open(2) when
there are around 1024 devices to scan on the system.
---
WHATS_NEW | 1 +
lib/device/bcache.c | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index fd1b732..bf03c49 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 3.0.0
=============
+ Reduce max concurrent aios to avoid EMFILE with many devices.
Fix lvconvert conversion attempts to linear.
Fix lvconvert raid0/raid0_meta -> striped regression.
Fix lvconvert --splitmirror for mirror type (2.02.178).
diff --git a/lib/device/bcache.c b/lib/device/bcache.c
index 8d55c36..e759997 100644
--- a/lib/device/bcache.c
+++ b/lib/device/bcache.c
@@ -198,7 +198,15 @@ static bool _async_issue(struct io_engine *ioe, enum dir d, int fd,
return true;
}
-#define MAX_IO 1024
+/*
+ * MAX_IO is returned to the layer above via bcache_max_prefetches() which
+ * tells the caller how many devices to submit io for concurrently. There will
+ * be an open file descriptor for each of these, so keep it low enough to avoid
+ * reaching the default max open file limit (1024) when there are over 1024
+ * devices being scanned.
+ */
+
+#define MAX_IO 256
#define MAX_EVENT 64
static bool _async_wait(struct io_engine *ioe, io_complete_fn fn)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=3c966e637fe1bec587ceb…
Commit: 3c966e637fe1bec587ceb9ad13aa009db64b4f8e
Parent: e83c4f07ca4a84808178d5d22cba655e5e370cd8
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Wed Aug 22 17:11:03 2018 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Wed Aug 22 17:12:44 2018 +0200
test: add striped -> raid0 test script
---
test/shell/lvconvert-striped-raid0.sh | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-striped-raid0.sh b/test/shell/lvconvert-striped-raid0.sh
new file mode 100644
index 0000000..5cfb792
--- /dev/null
+++ b/test/shell/lvconvert-striped-raid0.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2018 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux have_raid 1 7 0 || skip
+
+aux prepare_vg 3 16
+
+lvcreate -aey --type striped -i 3 -l3 -n $lv $vg
+lvconvert -y --type raid0_meta $vg/$lv
+check lv_field $vg/$lv segtype "raid0_meta"
+vgremove -ff $vg
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=10ede2cc0fdabaeb19c5b…
Commit: 10ede2cc0fdabaeb19c5b5b3341164432f6d4425
Parent: 4578411633a40c8c9068ff439ef3c33cbe78d25a
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Tue Aug 21 12:24:35 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Tue Aug 21 12:24:35 2018 -0500
config: improve use_blkid_wiping
mention that libblkid is used to both detect
and erase signatures.
---
lib/config/config_settings.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
index 7882e95..1d0cc79 100644
--- a/lib/config/config_settings.h
+++ b/lib/config/config_settings.h
@@ -471,7 +471,7 @@ cfg(allocation_maximise_cling_CFG, "maximise_cling", allocation_CFG_SECTION, 0,
"and revert to the previous algorithm.\n")
cfg(allocation_use_blkid_wiping_CFG, "use_blkid_wiping", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_USE_BLKID_WIPING, vsn(2, 2, 105), "@DEFAULT_USE_BLKID_WIPING@", 0, NULL,
- "Use blkid to detect existing signatures on new PVs and LVs.\n"
+ "Use blkid to detect and erase existing signatures on new PVs and LVs.\n"
"The blkid library can detect more signatures than the native LVM\n"
"detection code, but may take longer. LVM needs to be compiled with\n"
"blkid wiping support for this setting to apply. LVM native detection\n"
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=4578411633a40c8c9068f…
Commit: 4578411633a40c8c9068ff439ef3c33cbe78d25a
Parent: 8b05f1f230517aa42878aa160d94383ed0534c64
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Tue Aug 21 17:12:33 2018 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Tue Aug 21 17:28:56 2018 +0200
lvconvert: fix regression preventing direct striped conversion
Conversion to striped from raid0/raid0_meta is directly possible.
Fix a regression setting superfluous interim raid5_n conversion type
introduced by commit bd7cdd0b09ba123b064937fddde08daacbed7dab.
Add new test script lvconvert-raid0-striped.sh.
Resolves: rhbz1608067
---
WHATS_NEW | 1 +
lib/metadata/raid_manip.c | 3 +++
test/shell/lvconvert-raid0-striped.sh | 25 +++++++++++++++++++++++++
3 files changed, 29 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 0a0b6e9..0ea2789 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 3.0.0
=============
+ Fix lvconvert raid0/raid0_meta -> striped regression.
Fix lvconvert --splitmirror for mirror type (2.02.178).
Do not pair cache policy and cache metadata format.
lvconvert: reject conversions on raid1 LVs with split tracked SubLVs
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 931b411..5441527 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -6126,6 +6126,9 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr
if (seg_from->area_count == 1)
seg_flag = SEG_RAID1;
+ else if (seg_is_any_raid0(seg_from) && segtype_is_striped(*segtype))
+ ;
+
/* If this is any raid5 conversion request -> enforce raid5_n, because we convert from striped */
else if (((segtype_is_striped(*segtype) && !segtype_is_any_raid0(*segtype)) || segtype_is_any_raid5(*segtype)) &&
!segtype_is_raid5_n(*segtype))
diff --git a/test/shell/lvconvert-raid0-striped.sh b/test/shell/lvconvert-raid0-striped.sh
new file mode 100644
index 0000000..4521b34
--- /dev/null
+++ b/test/shell/lvconvert-raid0-striped.sh
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2018 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+
+SKIP_WITH_LVMPOLLD=1
+
+. lib/inittest
+
+aux have_raid 1 7 0 || skip
+
+aux prepare_vg 3 16
+
+lvcreate -aey --type raid0 -i 3 -l3 -n $lv $vg
+lvconvert -y --type striped $vg/$lv
+check lv_field $vg/$lv segtype "striped"
+vgremove -ff $vg
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=c34291e3bf61cc2644389…
Commit: c34291e3bf61cc2644389cbce77e9953f67a843a
Parent: 9adae653e98256901897e65aa349bb83a9f9ad5c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Aug 7 10:33:19 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Aug 7 17:57:00 2018 +0200
cache: drop metadata_format validation
Allow to use any combination of cache metadata format for policy.
---
WHATS_NEW | 1 +
lib/metadata/cache_manip.c | 5 -----
2 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 2c5b5d3..2cf7969 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 3.0.0
=============
+ Do not pair cache policy and cache metadata format.
lvconvert: reject conversions on raid1 LVs with split tracked SubLVs
lvconvert: reject conversions on raid1 split tracked SubLVs
Add basic creation support for VDO target.
diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c
index 4132e2f..5ba353c 100644
--- a/lib/metadata/cache_manip.c
+++ b/lib/metadata/cache_manip.c
@@ -842,15 +842,10 @@ int cache_set_metadata_format(struct lv_segment *seg, cache_metadata_format_t fo
/*
* If policy is unselected, but format 2 is selected, policy smq is enforced.
- * ATM no other then smq & cleaner policy is allowed to select format 2.
*/
if (!seg->policy_name) {
if (format == CACHE_METADATA_FORMAT_2)
seg->policy_name = "smq";
- } else if (strcmp(seg->policy_name, "smq") &&
- strcmp(seg->policy_name, "cleaner")) {
- seg->cache_metadata_format = CACHE_METADATA_FORMAT_1;
- return 1;
}
/* Check if we need to search for configured cache metadata format */
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=d1310242550e28dfe7c38…
Commit: d1310242550e28dfe7c386a78435235955963c95
Parent: acab59137869e2f8119d8faa09fdab5074b8c4b2
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Aug 7 10:34:59 2018 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Tue Aug 7 17:59:50 2018 +0200
tests: splitmirror for mirror type
---
test/shell/lvconvert-mirror-split.sh | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-mirror-split.sh b/test/shell/lvconvert-mirror-split.sh
new file mode 100644
index 0000000..40720a4
--- /dev/null
+++ b/test/shell/lvconvert-mirror-split.sh
@@ -0,0 +1,32 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2018 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# Check --splitmirrors for mirror segtype
+
+. lib/inittest
+
+aux prepare_vg 3
+
+###########################################
+# Mirror split tests
+###########################################
+# 3-way to 2-way/linear
+lvcreate --type mirror -m 2 -l 2 -n $lv1 $vg
+aux wait_for_sync $vg $lv1
+lvconvert --splitmirrors 1 -n $lv2 -vvvv $vg/$lv1
+
+check lv_exists $vg $lv1
+check linear $vg $lv2
+check active $vg $lv2
+# FIXME: ensure no residual devices
+
+vgremove -ff $vg
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9adae653e98256901897e…
Commit: 9adae653e98256901897e65aa349bb83a9f9ad5c
Parent: 763219611c30d6870013b7cb84d66ec67a5dd7ec
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Thu Aug 2 11:26:59 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Thu Aug 2 11:42:33 2018 -0500
mirrors: fix read_only_volume_list
If a mirror LV is listed in read_only_volume_list, it would
still be activated rw. The activation would initially be
readonly, but the monitoring function would immediately
change it to rw. This was a regression from commit
fade45b1d14c mirror: improve table update
The monitoring function needs to copy the read_only setting
into the new set of mirror activation options it uses.
---
lib/activate/activate.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index 28d67b4..d4a20c9 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1740,6 +1740,8 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume
if (!laopts)
laopts = &zlaopts;
+ else
+ mirr_laopts.read_only = laopts->read_only;
/* skip dmeventd code altogether */
if (dmeventd_monitor_mode() == DMEVENTD_MONITOR_IGNORE)
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=763219611c30d6870013b…
Commit: 763219611c30d6870013b7cb84d66ec67a5dd7ec
Parent: aa464aa2f6b438092a50ca20f149557550c7147b
Author: David Teigland <teigland(a)redhat.com>
AuthorDate: Wed Aug 1 10:26:28 2018 -0500
Committer: David Teigland <teigland(a)redhat.com>
CommitterDate: Wed Aug 1 11:22:23 2018 -0500
vgcreate: close exclusive fd after pvcreate
When vgcreate does an automatic pvcreate, it opens the
dev with O_EXCL to ensure no other subsystem is using
the device. This exclusive fd remained in bcache and
prevented activation parts of lvm from using the dev.
This appeared with vgcreate of a sanlock VG because of
the unique combination where the dev is not yet a PV,
so pvcreate is needed, and the vgcreate also creates
and activates an internal LV for sanlock.
Fix this by closing the exclusive fd after it's used
by pvcreate so that it won't interfere with other
bits of lvm that may try to use the device.
---
lib/label/label.c | 6 +++---
tools/toollib.c | 7 +++++++
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/lib/label/label.c b/lib/label/label.c
index d2c8685..9fe11f6 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -1185,7 +1185,7 @@ bool dev_write_bytes(struct device *dev, uint64_t start, size_t len, void *data)
return false;
}
- if (!(dev->flags & DEV_BCACHE_WRITE)) {
+ if (_in_bcache(dev) && !(dev->flags & DEV_BCACHE_WRITE)) {
/* FIXME: avoid tossing out bcache blocks just to replace fd. */
log_debug("Close and reopen to write %s", dev_name(dev));
bcache_invalidate_fd(scan_bcache, dev->bcache_fd);
@@ -1231,7 +1231,7 @@ bool dev_write_zeros(struct device *dev, uint64_t start, size_t len)
return false;
}
- if (!(dev->flags & DEV_BCACHE_WRITE)) {
+ if (_in_bcache(dev) && !(dev->flags & DEV_BCACHE_WRITE)) {
/* FIXME: avoid tossing out bcache blocks just to replace fd. */
log_debug("Close and reopen to write %s", dev_name(dev));
bcache_invalidate_fd(scan_bcache, dev->bcache_fd);
@@ -1277,7 +1277,7 @@ bool dev_set_bytes(struct device *dev, uint64_t start, size_t len, uint8_t val)
return false;
}
- if (!(dev->flags & DEV_BCACHE_WRITE)) {
+ if (_in_bcache(dev) && !(dev->flags & DEV_BCACHE_WRITE)) {
/* FIXME: avoid tossing out bcache blocks just to replace fd. */
log_debug("Close and reopen to write %s", dev_name(dev));
bcache_invalidate_fd(scan_bcache, dev->bcache_fd);
diff --git a/tools/toollib.c b/tools/toollib.c
index 36ae125..85d44b3 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -5782,6 +5782,13 @@ do_command:
pd->name);
}
+ /*
+ * Don't keep devs open excl in bcache because the excl will prevent
+ * using that dev elsewhere.
+ */
+ dm_list_iterate_items(devl, &rescan_devs)
+ label_scan_invalidate(devl->dev);
+
dm_list_iterate_items(pd, &pp->arg_fail)
log_debug("%s: command failed for %s.",
cmd->command->name, pd->name);