Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=07c25429e2b1eb08…
Commit: 07c25429e2b1eb08bb208a6bae015870c7ae635a
Parent: 9be7bca4be913f3edc4d4f838d72329475fa8655
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 6 11:50:18 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 6 11:54:36 2016 +0200
tests: verify repair of failing mirror
Improved test script to verify lost mirror image does not
cause mirror corruption while mirror is in use.
TODO: add more cases (lost mlog...), lost image from 3leg mirror...
---
test/shell/lvconvert-repair-mirror.sh | 75 +++++++++++++++++++++++++++++++++
1 files changed, 75 insertions(+), 0 deletions(-)
diff --git a/test/shell/lvconvert-repair-mirror.sh b/test/shell/lvconvert-repair-mirror.sh
new file mode 100644
index 0000000..242028d
--- /dev/null
+++ b/test/shell/lvconvert-repair-mirror.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+# Copyright (C) 2016 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_LVMLOCKD=1
+SKIP_WITH_LVMPOLLD=1
+
+MOUNT_DIR=mnt
+
+. lib/inittest
+
+cleanup_mounted_and_teardown()
+{
+ umount "$MOUNT_DIR" || true
+ aux teardown
+}
+
+aux lvmconf 'allocation/mirror_logs_require_separate_pvs = 1'
+
+aux prepare_vg 5
+
+################### Check lost mirror leg #################
+#
+# NOTE: using --regionsize 1M has major impact on my box
+# on read performance while mirror is synchronized
+# with the default 512K - my C2D T61 reads just couple MB/s!
+#
+lvcreate -aey --type mirror -L10 --regionsize 1M -m1 -n $lv1 $vg "$dev1" "$dev2" "$dev3"
+mkfs.ext4 "$DM_DEV_DIR/$vg/$lv1"
+mkdir "$MOUNT_DIR"
+
+aux delay_dev "$dev2" 0 500 $(get first_extent_sector "$dev2"):
+aux delay_dev "$dev4" 0 500 $(get first_extent_sector "$dev4"):
+#
+# Enforce syncronization
+# ATM requires unmounted/unused LV??
+#
+lvchange --yes --resync --noudevsync $vg/$lv1
+trap 'cleanup_mounted_and_teardown' EXIT
+mount "$DM_DEV_DIR/$vg/$lv1" "$MOUNT_DIR"
+
+# run 'dd' operation during failure of 'mlog/mimage' device
+
+dd if=/dev/zero of=mnt/zero bs=4K count=100 conv=fdatasync 2>err &
+
+PERCENT=$(get lv_field $vg/$lv1 copy_percent)
+PERCENT=${PERCENT%%\.*} # cut decimal
+test "$PERCENT" -lt 50 # and check less then 50% mirror is in sync
+#lvs -a -o+devices $vg
+
+#aux disable_dev "$dev3"
+aux disable_dev "$dev2"
+
+lvconvert --yes --repair $vg/$lv1
+lvs -a $vg
+
+aux enable_dev "$dev2"
+
+wait
+# dd MAY NOT HAVE produced any error message
+not grep error err
+
+lvs -a -o+devices $vg
+umount "$MOUNT_DIR"
+fsck -n "$DM_DEV_DIR/$vg/$lv1"
+
+aux enable_dev "$dev4"
+lvremove -ff $vg
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=5b2227c2c10c2f76…
Commit: 5b2227c2c10c2f762e238fedb756850fe4ac5d5d
Parent: 7c1937f8df1e843d00b9d5814c756234381ca0d1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Apr 6 10:29:57 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 6 11:31:02 2016 +0200
preload: preserve flushing state
When leaving preload routine it should not altet state of flush required
when it's been already set to 1 and drop it to 0.
The API here is unclean, but current usage expects the same
variable pointer is for all preload calls and combines 'flush_required'
across all of them.
---
lib/activate/dev_manager.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 994ba80..b3e97db 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3093,6 +3093,8 @@ int dev_manager_activate(struct dev_manager *dm, const struct logical_volume *lv
int dev_manager_preload(struct dev_manager *dm, const struct logical_volume *lv,
struct lv_activate_opts *laopts, int *flush_required)
{
+ dm->flush_required = *flush_required;
+
if (!_tree_action(dm, lv, laopts, PRELOAD))
return_0;
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d4c03cf7b21279ad…
Commit: d4c03cf7b21279ad28b8b9944d0281a55692efcc
Parent: 76fc41fb9d06519d7410f0054c279ea3a8dccc37
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Tue Apr 5 21:34:42 2016 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Wed Apr 6 11:31:02 2016 +0200
mirror: fix flushing for mirror target
Fix regression caused by commit ba41ee1dc94264f7ac8e61f8b1d56b10225b0d2f.
The idea was to use no_flush for changed device only for thin volumes
and thin pools but also to merge this with change made in commit
844b00958492224c448b30f89ae5532bb6591fd2.
However the resulting condition has caused misbehavior for the mirror
suspend - as that has been before the ONLY allowed target type
that could have been suspended with noflush.
Result was badly working repair for --type mirror that has been
passing 'flush' to the repaired mirror target whenever preload
wrongly set flush_required.
The origin code has required the flush_required to be set whenever
deivce size is changed.
Now it first detects if device size got smaller
'dm_tree_node_size_changed(root) < 0' - this requires flush.
Otherwise it checks device is not thin volume nor thin pool and its
size has changed (got bigger) and requires flush.
This mean upsize of thin-pool or thin volume will not require flush.
---
lib/activate/dev_manager.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 3563d5a..22331c3 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3044,12 +3044,11 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
if ((dm_tree_node_size_changed(root) < 0))
dm->flush_required = 1;
-
/* Currently keep the code require flush for any
- * non 'thin pool/volume, mirror' or with any size change */
- if (!lv_is_thin_volume(lv) &&
- !lv_is_thin_pool(lv) &&
- (!lv_is_mirror(lv) || dm_tree_node_size_changed(root)))
+ * non 'thin pool/volume' and size increase */
+ else if (!lv_is_thin_volume(lv) &&
+ !lv_is_thin_pool(lv) &&
+ dm_tree_node_size_changed(root))
dm->flush_required = 1;
if (action == ACTIVATE) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7a02139d22551405…
Commit: 7a02139d22551405d4317671a312ef5cc20c2db0
Parent: 0000000000000000000000000000000000000000
Author: Alasdair G Kergon <agk(a)redhat.com>
AuthorDate: 2016-04-01 19:30 +0000
Committer: Alasdair G Kergon <agk(a)redhat.com>
CommitterDate: 2016-04-01 19:30 +0000
annotated tag: v2_02_149 has been created
at 7a02139d22551405d4317671a312ef5cc20c2db0 (tag)
tagging 2d0d58b8679f0d071c194db34660a112ae0f3204 (commit)
replaces v2_02_148
Release 2.02.149.
A small development release including fixes for some recent changes.
21 files changed, 265 insertions(+), 77 deletions(-)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.14 (GNU/Linux)
iEYEABECAAYFAlb+zK8ACgkQIoGRwVZ+LBc/SQCfVsGYacni96Ps6N01aXCdqgFU
EHUAn25BkfYNAAbt5Ob6PIEVIaGjmzD+
=DzKi
-----END PGP SIGNATURE-----
Alasdair G Kergon (3):
post-commit
Revert "thin: display highest mapped sector"
pre-release
Marian Csontos (1):
test: Add missing directory
Peter Rajnoha (13):
dev-cache: handle situation where device is referenced in sysfs, but the node is not yet in dev dir
dev-cache: also index VGIDs and LVIDs if using persistent .cache file
dev-cache: remove spurious error msg if no value found in /sys/dev/block/<major>:<minor>/dm/uuid during dev scan
dev-cache: dev_cache_index_devs fn is available unconditionally
doc: describe lvmlockd/lvmpolld features as available if LVM compiled with lockd/polld support
dev-cache: fix check for already indexed dev in _index_dev_by_vgid_and_lvid
tests: vg-check-devs-used requires driver version 4.15 at least
refactor: dev-cache: use btree instead of hash table for sysfs-only devices
refactor: dev-cache: move code adding sysfs-only device into separate fn
dev-cache: also add dev name for device found in sysfs only
dev-cache: iterate devices in sysfs for VGID/LVID index if obtain_device_list_from_udev=0
fix: make udev_get_library_context available also for non-udev compilations
dev-cache: skip VGID/LVID indexing if /sys/dev/block is not present
Zdenek Kabelac (7):
thin: no thin-pool flush when reading metadata status
thin: display highest mapped sector
cleanup: debug message fix
cleanup: use TARGET define
cleanup: use local var to read struct
tests: do not test settings when MQ is emulated by SMQ
tests: fixed cache target reacts faster
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=7ed5a65ee5ccb92d…
Commit: 7ed5a65ee5ccb92de388977cff0dc697045ffc09
Parent: 91d32f9d1ba1ff3bed0f47104721e97960df3878
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Apr 1 10:09:03 2016 +0200
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Apr 1 14:48:56 2016 +0200
dev-cache: also add dev name for device found in sysfs only
For the case when we print device name associated with struct device
that was not found in /dev, but in sysfs, for example when printing
devices where LV device mismatch is found.
---
lib/device/dev-cache.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 12dcceb..27540d9 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -433,11 +433,29 @@ static struct dm_list *_get_or_add_list_by_index_key(struct dm_hash_table *idx,
static struct device *_insert_sysfs_dev(dev_t devno, const char *devname)
{
+ char path[PATH_MAX];
+ char *path_copy;
struct device *dev;
+ if (dm_snprintf(path, sizeof(path), "%s%s", _cache.dev_dir, devname) < 0) {
+ log_error("_insert_sysfs_dev: %s: dm_snprintf failed", devname);
+ return NULL;
+ }
+
if (!(dev = _dev_create(devno)))
return_NULL;
+ if (!(path_copy = dm_pool_strdup(_cache.mem, path))) {
+ log_error("_insert_sysfs_dev: %s: dm_pool_strdup failed", devname);
+ return NULL;
+ }
+
+ if (!_add_alias(dev, path_copy)) {
+ log_error("Couldn't add alias to dev cache.");
+ _free(dev);
+ return NULL;
+ }
+
if (!btree_insert(_cache.sysfs_only_devices, (uint32_t) devno, dev)) {
log_error("Couldn't add device to binary tree of sysfs-only devices in dev cache.");
_free(dev);