Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=8a93cde75ef4a4b2…
Commit: 8a93cde75ef4a4b260d937c5924267d0eab31df3
Parent: d90320f4f161658c6a004631c5685b40202af2cc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jan 6 12:41:38 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jan 6 12:45:07 2017 +0100
mirror: relax internal error for a while
With recent commit d6a74025df1afb3d76bec435bc6a40d649217b42 using
INTERNAL_ERROR while cheking layer LV - it's been noticed mirror
logic currently doesn't do a correct thing during upconversion and
does a full-try instead of checking only allocator capabilities.
This leads to invalid usage of layer.
To keep existing code running before providing a fix, relax
INTERNAL_ERROR just an error and keep the 'code' running.
Once mirror code is fixed, these all check should be switched
to internal errors.
---
lib/metadata/lv_manip.c | 42 +++++++++++++++++++++++++++++++++++-------
1 files changed, 35 insertions(+), 7 deletions(-)
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index ad400b2..3feec20 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -6533,13 +6533,41 @@ int remove_layer_from_lv(struct logical_volume *lv,
* Before removal, the layer should be cleaned up,
* i.e. additional segments and areas should have been removed.
*/
- if (dm_list_size(&parent_lv->segments) != 1 ||
- parent_seg->area_count != 1 ||
- seg_type(parent_seg, 0) != AREA_LV ||
- layer_lv != seg_lv(parent_seg, 0) ||
- parent_lv->le_count != layer_lv->le_count) {
- log_error(INTERNAL_ERROR "Inconsistent sizes of layer %s.",
- display_lvname(lv));
+ /* FIXME:
+ * These are all INTERNAL_ERROR, but ATM there is
+ * some internal API problem and this code is wrongle
+ * executed with certain mirror manipulations.
+ * So we need to fix mirror code first, then switch...
+ */
+ if (dm_list_size(&parent_lv->segments) != 1) {
+ log_error("Invalid %d segments in %s, expected only 1.",
+ dm_list_size(&parent_lv->segments),
+ display_lvname(parent_lv));
+ return 0;
+ }
+
+ if (parent_seg->area_count != 1) {
+ log_error("Invalid %d area count(s) in %s, expected only 1.",
+ parent_seg->area_count, display_lvname(parent_lv));
+ return 0;
+ }
+
+ if (seg_type(parent_seg, 0) != AREA_LV) {
+ log_error("Invalid seg_type %d in %s, expected LV.",
+ seg_type(parent_seg, 0), display_lvname(parent_lv));
+ return 0;
+ }
+
+ if (layer_lv != seg_lv(parent_seg, 0)) {
+ log_error("Layer doesn't match segment in %s.",
+ display_lvname(parent_lv));
+ return 0;
+ }
+
+ if (parent_lv->le_count != layer_lv->le_count) {
+ log_error("Inconsistent extent count (%u != %u) of layer %s.",
+ parent_lv->le_count, layer_lv->le_count,
+ display_lvname(parent_lv));
return 0;
}
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d90320f4f161658c…
Commit: d90320f4f161658c6a004631c5685b40202af2cc
Parent: b92a9c3e1ab9972b059ef797136c7e04b4b9368f
Author: Peter Rajnoha <prajnoha(a)redhat.com>
AuthorDate: Fri Jan 6 11:16:07 2017 +0100
Committer: Peter Rajnoha <prajnoha(a)redhat.com>
CommitterDate: Fri Jan 6 11:16:07 2017 +0100
blkdeactivate: also unmount mount point on top of MD device if using blkdeactivate -u
The blkdeactivate script processes MD devices too so we should unmount
any mount point on top of an MD device if blkdeactivate -u|--umount is
called.
Diagnosed and reported by: Rick Warner <rick(a)microway.com>
See also https://bugzilla.redhat.com/show_bug.cgi?id=1410585.
---
WHATS_NEW | 1 +
scripts/blkdeactivate.sh.in | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 3fde645..44b1df8 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.169 -
=====================================
+ Also unmount mount point on top of MD device if using blkdeactivate -u.
Restore check preventing resize of cache type volumes (2.02.158).
Add missing udev sync when flushing dirty cache content.
vgchange -p accepts only uint32 numbers.
diff --git a/scripts/blkdeactivate.sh.in b/scripts/blkdeactivate.sh.in
index 443af9c..436c72e 100644
--- a/scripts/blkdeactivate.sh.in
+++ b/scripts/blkdeactivate.sh.in
@@ -171,7 +171,8 @@ device_umount_one() {
}
device_umount() {
- test "$devtype" != "lvm" && test "${kname:0:3}" != "dm-" && return 0
+ test "$devtype" != "lvm" && test "${kname:0:3}" != "dm-" \
+ && test "${kname:0:2}" != "md" && return 0
# FINDMNT is defined only if umount --all-targets is not available.
# In that case, read the list of multiple mount points of one device
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=c64f4447d92c4c8b…
Commit: c64f4447d92c4c8bc72d33a9615ef62fcef41168
Parent: 74969c9a38c286037d499a6ed603b1ae806cd37b
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jan 4 11:21:20 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 5 15:54:14 2017 +0100
tests: drop FIXME
Since we fixed core trouble with sequence of
suspend/resume/suspend without udev wait
we can drop 'should' and expect volume is still mounted.
---
test/shell/lvconvert-thin-external-cache.sh | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/test/shell/lvconvert-thin-external-cache.sh b/test/shell/lvconvert-thin-external-cache.sh
index dae65a0..c4d7d61 100644
--- a/test/shell/lvconvert-thin-external-cache.sh
+++ b/test/shell/lvconvert-thin-external-cache.sh
@@ -50,11 +50,8 @@ not lvconvert --thin --thinpool $vg/tpool $vg/$lv1
# Switch to 'writethrough' - this should be supported
lvchange --cachemode writethrough $vg/$lv1
-# FIXME
-# systemd on fc23 'strikes-in' and unmounts mnt
-# ATM the reason is unclear (bug in systemd, bad udev rules?)
-# as a workaround mount again and 'WARN' test
-should not mount "$DM_DEV_DIR/$vg/$lv1" mnt
+# Check $lv1 remains mounted (so it's not been unmounted by systemd)
+not mount "$DM_DEV_DIR/$vg/$lv1" mnt
lvconvert --thin $vg/$lv1 --originname extorg --thinpool $vg/tpool
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3e9c03cbbcf10202…
Commit: 3e9c03cbbcf102029d11f312e1cd1d20284b6d03
Parent: 1f5dde38a7ec18d86c38c0b7e1cb2a953ea5cf44
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jan 5 15:32:25 2017 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Thu Jan 5 15:34:22 2017 +0100
cache: resize is still unsupported
During rework of resize code this validation check
has been lost (in my resize branch). Upstream
is still not supporting resize of any cache type LV
so needs to be prevented.
---
WHATS_NEW | 1 +
lib/metadata/lv_manip.c | 5 +++++
2 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 5fb5904..3fde645 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.169 -
=====================================
+ Restore check preventing resize of cache type volumes (2.02.158).
Add missing udev sync when flushing dirty cache content.
vgchange -p accepts only uint32 numbers.
Report thin LV date for merged LV when the merge is in progress.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 9759cda..a954bf7 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4687,6 +4687,11 @@ static int _lvresize_check(struct logical_volume *lv,
return 0;
}
+ if (lv_is_cache_type(lv)) {
+ log_error("Unable to resize logical volumes of cache type.");
+ return 0;
+ }
+
if (!lv_is_visible(lv) &&
!lv_is_thin_pool_metadata(lv) &&
!lv_is_lockd_sanlock_lv(lv)) {