summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2016-04-05 21:34:42 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2016-04-06 11:31:02 +0200
commitd4c03cf7b21279ad28b8b9944d0281a55692efcc (patch)
tree0b9f274eee136a4f00752b76c2986e78d1b6ffc4
parent76fc41fb9d06519d7410f0054c279ea3a8dccc37 (diff)
downloadlvm2-d4c03cf7b21279ad28b8b9944d0281a55692efcc.tar.gz
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.
-rw-r--r--lib/activate/dev_manager.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index 3563d5a39..22331c3b7 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) {