master - lvconvert: disable reshaping of RAID LVs in the cluster
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fb46175ce7550fd6c9f...
Commit: fb46175ce7550fd6c9f40e6d8eec337fc2693e80
Parent: 1c212b8a43750ea48b9e96da75c1349682c81454
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Jun 19 20:01:01 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Jun 19 21:06:53 2017 +0200
lvconvert: disable reshaping of RAID LVs in the cluster
Disable until we have a proper fix for reshape space allocation,
switching it to begin/end of rimages and activation in the cluster.
Related: rhbz1448116
Related: rhbz1461526
Related: rhbz1448123
---
lib/metadata/raid_manip.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 5c3f9ef..6abf482 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -6319,6 +6319,12 @@ int lv_raid_convert(struct logical_volume *lv,
case 0:
break;
case 1:
+ /* Conversion of reshapable raids is the cluster is not supported yet. */
+ if (locking_is_clustered()) {
+ log_error("Conversion of %s not supported in the cluster.", display_lvname(lv));
+ return 0;
+ }
+
if (!_raid_reshape(lv, new_segtype, yes, force,
data_copies, region_size,
stripes, stripe_size, allocate_pvs)) {
6 years, 10 months
master - lvconvert: disable reshaping of RAID LVs in the cluster
by Heinz Mauelshagen
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=76a327f084705fafa93...
Commit: 76a327f084705fafa9374e6256ad7143668adc80
Parent: 1c212b8a43750ea48b9e96da75c1349682c81454
Author: Heinz Mauelshagen <heinzm(a)redhat.com>
AuthorDate: Mon Jun 19 20:01:01 2017 +0200
Committer: Heinz Mauelshagen <heinzm(a)redhat.com>
CommitterDate: Mon Jun 19 20:01:01 2017 +0200
lvconvert: disable reshaping of RAID LVs in the cluster
Disable until we have a proper fix for reshape space allocation,
switching it to begin/end of rimages and activation in the cluster.
Related: rhbz1461526
---
lib/metadata/raid_manip.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 5c3f9ef..6abf482 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -6319,6 +6319,12 @@ int lv_raid_convert(struct logical_volume *lv,
case 0:
break;
case 1:
+ /* Conversion of reshapable raids is the cluster is not supported yet. */
+ if (locking_is_clustered()) {
+ log_error("Conversion of %s not supported in the cluster.", display_lvname(lv));
+ return 0;
+ }
+
if (!_raid_reshape(lv, new_segtype, yes, force,
data_copies, region_size,
stripes, stripe_size, allocate_pvs)) {
6 years, 10 months
master - fsadm: restore no answer
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=1c212b8a43750ea48b9...
Commit: 1c212b8a43750ea48b9e96da75c1349682c81454
Parent: 915d20d0e64e8bf7a91f01c21cb8c30428ddb1e1
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Mon Jun 19 12:37:40 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Mon Jun 19 12:40:03 2017 +0200
fsadm: restore no answer
Commit 1fe4f80e45a6bfcceed5aaab97fc0e27dfcf2b88 in current version
introduced regression for a terminal user, as he could not enter 'n'
as answer. Add missing break for this case (No whats_new).
---
scripts/fsadm.sh | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/scripts/fsadm.sh b/scripts/fsadm.sh
index ea14efe..adf9b55 100755
--- a/scripts/fsadm.sh
+++ b/scripts/fsadm.sh
@@ -402,6 +402,7 @@ yes_no() {
while read -r -s -n 1 ANS ; do
case "$ANS" in
"y" | "Y" ) echo y ; return 0 ;;
+ "n" | "N") break ;;
"" ) if [ -t 1 ] ; then
echo y ; return 0
fi ;;
6 years, 10 months
master - test: New test file for validating kernel status during sync ops
by Jonathan Brassow
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=915d20d0e64e8bf7a91...
Commit: 915d20d0e64e8bf7a91f01c21cb8c30428ddb1e1
Parent: dd866a67f44ad44512388cf2e073511d88b9c19c
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Fri Jun 16 10:11:58 2017 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Fri Jun 16 10:16:07 2017 -0500
test: New test file for validating kernel status during sync ops
New tests to add checking for '100%' in-sync at start of "recover"
process (it shouldn't happen, but I've seen it before). Also,
check status over the whole cycle of various sync processes ("resync"
and "recover").
---
test/shell/lvconvert-raid-status-validation.sh | 95 +++++++++++++++++++++++-
1 files changed, 94 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvconvert-raid-status-validation.sh b/test/shell/lvconvert-raid-status-validation.sh
index 0da0b7a..d705cc2 100644
--- a/test/shell/lvconvert-raid-status-validation.sh
+++ b/test/shell/lvconvert-raid-status-validation.sh
@@ -20,7 +20,7 @@ vgcreate -s 2m $vg $(cat DEVICES)
###########################################
# Upconverted RAID1 should never have all 'a's in status output
###########################################
-aux delay_dev $dev2 0 100
+aux delay_dev $dev2 0 50
lvcreate -aey -l 2 -n $lv1 $vg $dev1
lvconvert --type raid1 -y -m 1 $vg/$lv1 $dev2
while ! check in_sync $vg $lv1; do
@@ -31,4 +31,97 @@ done
aux enable_dev $dev2
lvremove -ff $vg
+###########################################
+# Upconverted RAID1 should not be at 100% right after upconvert
+###########################################
+aux delay_dev $dev2 0 50
+lvcreate -aey -l 2 -n $lv1 $vg $dev1
+lvconvert --type raid1 -y -m 1 $vg/$lv1 $dev2
+a=( $(dmsetup status $vg-$lv1) ) || die "Unable to get status of $vg/$lv1"
+b=( $(echo ${a[6]} | sed s:/:' ':) )
+[ ${b[0]} -ne ${b[1]} ]
+aux enable_dev $dev2
+lvremove -ff $vg
+
+###########################################
+# Catch anything suspicious with linear -> RAID1 upconvert
+###########################################
+aux delay_dev $dev2 0 50
+lvcreate -aey -l 2 -n $lv1 $vg $dev1
+lvconvert --type raid1 -y -m 1 $vg/$lv1 $dev2
+while true; do
+ a=( $(dmsetup status $vg-$lv1) ) || die "Unable to get status of $vg/$lv1"
+ b=( $(echo ${a[6]} | sed s:/:' ':) )
+ if [ ${b[0]} -ne ${b[1]} ]; then
+ # If the sync operation ("recover" in this case) is not
+ # finished, then it better be as follows:
+ [ ${a[5]} == "Aa" ]
+ [ ${a[7]} == "recover" ]
+ else
+ # Tough to tell the INVALID case,
+ # Before starting sync thread: "Aa X/X recover"
+ # from the valid case,
+ # Just finished sync thread: "Aa X/X recover"
+ # We'll just put "should" for now
+ should [ ${a[5]} == "AA" ]
+ should [ ${a[7]} == "idle" ]
+ break
+ fi
+ sleep .1
+done
+aux enable_dev $dev2
+lvremove -ff $vg
+
+###########################################
+# Catch anything suspicious with RAID1 2-way -> 3-way upconvert
+###########################################
+aux delay_dev $dev3 0 50
+lvcreate --type raid1 -m 1 -aey -l 2 -n $lv1 $vg $dev1 $dev2
+lvconvert -y -m +1 $vg/$lv1 $dev3
+while true; do
+ a=( $(dmsetup status $vg-$lv1) ) || die "Unable to get status of $vg/$lv1"
+ b=( $(echo ${a[6]} | sed s:/:' ':) )
+ if [ ${b[0]} -ne ${b[1]} ]; then
+ # If the sync operation ("recover" in this case) is not
+ # finished, then it better be as follows:
+ [ ${a[5]} == "AAa" ]
+ [ ${a[7]} == "recover" ]
+ else
+ # Tough to tell the INVALID case,
+ # Before starting sync thread: "Aa X/X recover"
+ # from the valid case,
+ # Just finished sync thread: "Aa X/X recover"
+ # We'll just put "should" for now
+ should [ ${a[5]} == "AAA" ]
+ should [ ${a[7]} == "idle" ]
+ break
+ fi
+ sleep .1
+done
+aux enable_dev $dev3
+lvremove -ff $vg
+
+###########################################
+# Catch anything suspicious with RAID1 initial resync
+###########################################
+aux delay_dev $dev2 0 50
+lvcreate --type raid1 -m 1 -aey -l 2 -n $lv1 $vg $dev1 $dev2
+while true; do
+ a=( $(dmsetup status $vg-$lv1) ) || die "Unable to get status of $vg/$lv1"
+ b=( $(echo ${a[6]} | sed s:/:' ':) )
+ if [ ${b[0]} -ne ${b[1]} ]; then
+ # If the sync operation ("resync" in this case) is not
+ # finished, then it better be as follows:
+ [ ${a[5]} == "aa" ]
+ [ ${a[7]} == "resync" ]
+ else
+ should [ ${a[5]} == "AA" ]
+ should [ ${a[7]} == "idle" ]
+ break
+ fi
+ sleep .1
+done
+aux enable_dev $dev2
+lvremove -ff $vg
+
vgremove -ff $vg
6 years, 10 months
master - test: New test file for validating kernel status during sync ops
by Jonathan Brassow
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=7cdac3cef9d6ac57ff1...
Commit: 7cdac3cef9d6ac57ff1dd21be49e01b542625fe7
Parent: 40e0dcf70d5a719671916aa88adf9a8f18e096c6
Author: Jonathan Brassow <jbrassow(a)redhat.com>
AuthorDate: Fri Jun 16 10:11:58 2017 -0500
Committer: Jonathan Brassow <jbrassow(a)redhat.com>
CommitterDate: Fri Jun 16 10:11:58 2017 -0500
test: New test file for validating kernel status during sync ops
New tests to add checking for '100%' in-sync at start of "recover"
process (it shouldn't happen, but I've seen it before). Also,
check status over the whole cycle of various sync processes ("resync"
and "recover").
---
test/shell/lvconvert-raid-status-validation.sh | 95 +++++++++++++++++++++++-
1 files changed, 94 insertions(+), 1 deletions(-)
diff --git a/test/shell/lvconvert-raid-status-validation.sh b/test/shell/lvconvert-raid-status-validation.sh
index 0da0b7a..d705cc2 100644
--- a/test/shell/lvconvert-raid-status-validation.sh
+++ b/test/shell/lvconvert-raid-status-validation.sh
@@ -20,7 +20,7 @@ vgcreate -s 2m $vg $(cat DEVICES)
###########################################
# Upconverted RAID1 should never have all 'a's in status output
###########################################
-aux delay_dev $dev2 0 100
+aux delay_dev $dev2 0 50
lvcreate -aey -l 2 -n $lv1 $vg $dev1
lvconvert --type raid1 -y -m 1 $vg/$lv1 $dev2
while ! check in_sync $vg $lv1; do
@@ -31,4 +31,97 @@ done
aux enable_dev $dev2
lvremove -ff $vg
+###########################################
+# Upconverted RAID1 should not be at 100% right after upconvert
+###########################################
+aux delay_dev $dev2 0 50
+lvcreate -aey -l 2 -n $lv1 $vg $dev1
+lvconvert --type raid1 -y -m 1 $vg/$lv1 $dev2
+a=( $(dmsetup status $vg-$lv1) ) || die "Unable to get status of $vg/$lv1"
+b=( $(echo ${a[6]} | sed s:/:' ':) )
+[ ${b[0]} -ne ${b[1]} ]
+aux enable_dev $dev2
+lvremove -ff $vg
+
+###########################################
+# Catch anything suspicious with linear -> RAID1 upconvert
+###########################################
+aux delay_dev $dev2 0 50
+lvcreate -aey -l 2 -n $lv1 $vg $dev1
+lvconvert --type raid1 -y -m 1 $vg/$lv1 $dev2
+while true; do
+ a=( $(dmsetup status $vg-$lv1) ) || die "Unable to get status of $vg/$lv1"
+ b=( $(echo ${a[6]} | sed s:/:' ':) )
+ if [ ${b[0]} -ne ${b[1]} ]; then
+ # If the sync operation ("recover" in this case) is not
+ # finished, then it better be as follows:
+ [ ${a[5]} == "Aa" ]
+ [ ${a[7]} == "recover" ]
+ else
+ # Tough to tell the INVALID case,
+ # Before starting sync thread: "Aa X/X recover"
+ # from the valid case,
+ # Just finished sync thread: "Aa X/X recover"
+ # We'll just put "should" for now
+ should [ ${a[5]} == "AA" ]
+ should [ ${a[7]} == "idle" ]
+ break
+ fi
+ sleep .1
+done
+aux enable_dev $dev2
+lvremove -ff $vg
+
+###########################################
+# Catch anything suspicious with RAID1 2-way -> 3-way upconvert
+###########################################
+aux delay_dev $dev3 0 50
+lvcreate --type raid1 -m 1 -aey -l 2 -n $lv1 $vg $dev1 $dev2
+lvconvert -y -m +1 $vg/$lv1 $dev3
+while true; do
+ a=( $(dmsetup status $vg-$lv1) ) || die "Unable to get status of $vg/$lv1"
+ b=( $(echo ${a[6]} | sed s:/:' ':) )
+ if [ ${b[0]} -ne ${b[1]} ]; then
+ # If the sync operation ("recover" in this case) is not
+ # finished, then it better be as follows:
+ [ ${a[5]} == "AAa" ]
+ [ ${a[7]} == "recover" ]
+ else
+ # Tough to tell the INVALID case,
+ # Before starting sync thread: "Aa X/X recover"
+ # from the valid case,
+ # Just finished sync thread: "Aa X/X recover"
+ # We'll just put "should" for now
+ should [ ${a[5]} == "AAA" ]
+ should [ ${a[7]} == "idle" ]
+ break
+ fi
+ sleep .1
+done
+aux enable_dev $dev3
+lvremove -ff $vg
+
+###########################################
+# Catch anything suspicious with RAID1 initial resync
+###########################################
+aux delay_dev $dev2 0 50
+lvcreate --type raid1 -m 1 -aey -l 2 -n $lv1 $vg $dev1 $dev2
+while true; do
+ a=( $(dmsetup status $vg-$lv1) ) || die "Unable to get status of $vg/$lv1"
+ b=( $(echo ${a[6]} | sed s:/:' ':) )
+ if [ ${b[0]} -ne ${b[1]} ]; then
+ # If the sync operation ("resync" in this case) is not
+ # finished, then it better be as follows:
+ [ ${a[5]} == "aa" ]
+ [ ${a[7]} == "resync" ]
+ else
+ should [ ${a[5]} == "AA" ]
+ should [ ${a[7]} == "idle" ]
+ break
+ fi
+ sleep .1
+done
+aux enable_dev $dev2
+lvremove -ff $vg
+
vgremove -ff $vg
6 years, 10 months
master - tests: use exclusive activation
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=dd866a67f44ad445123...
Commit: dd866a67f44ad44512388cf2e073511d88b9c19c
Parent: fbb3bffb221f3c0275bafef4f2cc7ea299214ef4
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 14 13:59:11 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 16 17:04:02 2017 +0200
tests: use exclusive activation
Conversion needs exlusively active LV for clustered testing.
---
.../shell/lvconvert-raid-takeover-alloc-failure.sh | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/test/shell/lvconvert-raid-takeover-alloc-failure.sh b/test/shell/lvconvert-raid-takeover-alloc-failure.sh
index 3870c35..cf926a1 100644
--- a/test/shell/lvconvert-raid-takeover-alloc-failure.sh
+++ b/test/shell/lvconvert-raid-takeover-alloc-failure.sh
@@ -48,7 +48,7 @@ function check_no_sub_lvs
# Check takover upconversion fails allocation errors nicely without leaving image pair remnants behind
# 6-way striped: neither conversion to raid5 nor raid6 possible
-lvcreate --yes --stripes 6 --size 4M --name $lv1 $vg
+lvcreate -aey --yes --stripes 6 --size 4M --name $lv1 $vg
not lvconvert --yes --type raid4 $vg/$lv1
check lv_field $vg/$lv1 segtype "striped"
check_no_sub_lvs $vg $lv1 0 5
@@ -69,7 +69,7 @@ check_sub_lvs $vg $lv1 0 5
lvremove -y $vg
# 5-way striped: conversion to raid5 possible but not to raid6
-lvcreate --yes --stripes 5 --size 4M --name $lv1 $vg
+lvcreate -aey --stripes 5 --size 4M --name $lv1 $vg
not lvconvert --yes --type raid6 $vg/$lv1
check lv_field $vg/$lv1 segtype "striped"
check_no_sub_lvs $vg $lv1 0 5
@@ -83,7 +83,7 @@ check_sub_lvs $vg $lv1 0 5
lvremove -y $vg
# 4-way striped: conversion to raid5 and raid6 possible
-lvcreate --yes --stripes 4 --size 4M --name $lv1 $vg
+lvcreate -aey --stripes 4 --size 4M --name $lv1 $vg
lvconvert --yes --type raid5 $vg/$lv1
check lv_field $vg/$lv1 segtype "raid5_n"
check lv_field $vg/$lv1 stripes 5
@@ -92,7 +92,8 @@ check_sub_lvs $vg $lv1 0 4
check_no_sub_lvs $vg $lv1 5 5
lvremove -y $vg
-lvcreate --yes --stripes 4 --size 4M --name $lv1 $vg
+
+lvcreate -aey --stripes 4 --size 4M --name $lv1 $vg
lvconvert --yes --type raid6 $vg/$lv1
check lv_field $vg/$lv1 segtype "raid6_n_6"
check lv_field $vg/$lv1 stripes 6
6 years, 10 months
master - debug: passing non-raid seg would be internal error
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fbb3bffb221f3c0275b...
Commit: fbb3bffb221f3c0275bafef4f2cc7ea299214ef4
Parent: 9e96f96a410c7ff977fa8593dff185fbe90615fe
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Jun 16 16:24:38 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 16 17:04:02 2017 +0200
debug: passing non-raid seg would be internal error
---
lib/metadata/lv.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c
index 555df1a..c87bb6b 100644
--- a/lib/metadata/lv.c
+++ b/lib/metadata/lv.c
@@ -1096,7 +1096,7 @@ int lv_raid_healthy(const struct logical_volume *lv)
}
if (!seg_is_raid(raid_seg)) {
- log_error("%s on %s is not a RAID segment",
+ log_error(INTERNAL_ERROR "%s on %s is not a RAID segment.",
raid_seg->lv->name, lv->name);
return 0;
}
6 years, 10 months
master - cleanup: drop unused parameter
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=9e96f96a410c7ff977f...
Commit: 9e96f96a410c7ff977fa8593dff185fbe90615fe
Parent: cdb55c19cd7633cd3467525f6f2b84ef77350d72
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 15 11:21:06 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 16 17:04:02 2017 +0200
cleanup: drop unused parameter
---
lib/metadata/raid_manip.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 0f52ecf..5c3f9ef 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -3994,7 +3994,6 @@ static int _convert_raid1_to_mirror(struct logical_volume *lv,
uint32_t new_image_count,
uint32_t new_region_size,
struct dm_list *allocate_pvs,
- int update_and_reload,
struct dm_list *removal_lvs)
{
struct logical_volume *log_lv;
@@ -4051,7 +4050,10 @@ static int _convert_raid1_to_mirror(struct logical_volume *lv,
if (!attach_mirror_log(first_seg(lv), log_lv))
return_0;
- return update_and_reload ? _lv_update_reload_fns_reset_eliminate_lvs(lv, 0, removal_lvs, NULL) : 1;
+ if (!_lv_update_reload_fns_reset_eliminate_lvs(lv, 0, removal_lvs, NULL))
+ return_0;
+
+ return 1;
}
/*
@@ -4786,7 +4788,7 @@ static int _raid1_to_mirrored_wrapper(TAKEOVER_FN_ARGS)
return_0;
return _convert_raid1_to_mirror(lv, new_segtype, new_image_count, new_region_size,
- allocate_pvs, 1, &removal_lvs);
+ allocate_pvs, &removal_lvs);
}
/*
6 years, 10 months
master - cleanup: show what happens when passed prompt
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=cdb55c19cd7633cd346...
Commit: cdb55c19cd7633cd3467525f6f2b84ef77350d72
Parent: 14816222a19c01e3846d8a38f89113613ae531e8
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Thu Jun 15 11:53:01 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 16 17:04:02 2017 +0200
cleanup: show what happens when passed prompt
When we show prompt and user passes --yes - we still
do tell user which action is going to happen.
---
lib/metadata/raid_manip.c | 27 ++++++++++++++++-----------
1 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 87b6c01..0f52ecf 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -3220,11 +3220,13 @@ int lv_raid_split(struct logical_volume *lv, int yes, const char *split_name,
}
/* Split on a 2-legged raid1 LV causes losing all resilience */
- if (new_count == 1 &&
- !yes && yes_no_prompt("Are you sure you want to split %s LV %s losing all resilience? [y/n]: ",
- lvseg_name(first_seg(lv)), display_lvname(lv)) == 'n') {
- log_error("Logical volume %s NOT split.", display_lvname(lv));
- return 0;
+ if (new_count == 1) {
+ if (!yes && yes_no_prompt("Are you sure you want to split %s LV %s losing all resilience? [y/n]: ",
+ lvseg_name(first_seg(lv)), display_lvname(lv)) == 'n') {
+ log_error("Logical volume %s NOT split.", display_lvname(lv));
+ return 0;
+ }
+ log_verbose("Losing all resilience for logical volume %s.", display_lvname(lv));
}
/*
@@ -3362,11 +3364,14 @@ int lv_raid_split_and_track(struct logical_volume *lv,
}
/* Split and track changes on a 2-legged raid1 LV causes losing resilience for newly written data. */
- if (seg->area_count == 2 &&
- !yes && yes_no_prompt("Are you sure you want to split and track %s LV %s losing resilience for any newly written data? [y/n]: ",
- lvseg_name(seg), display_lvname(lv)) == 'n') {
- log_error("Logical volume %s NOT split.", display_lvname(lv));
- return 0;
+ if (seg->area_count == 2) {
+ if (!yes && yes_no_prompt("Are you sure you want to split and track %s LV %s losing resilience for any newly written data? [y/n]: ",
+ lvseg_name(seg), display_lvname(lv)) == 'n') {
+ log_error("Logical volume %s NOT split.", display_lvname(lv));
+ return 0;
+ }
+ log_verbose("Losing resilience for newly written data on logical volume %s.",
+ display_lvname(lv));
}
for (s = seg->area_count - 1; s >= 0; --s) {
@@ -3395,7 +3400,7 @@ int lv_raid_split_and_track(struct logical_volume *lv,
return_0;
if (seg->area_count == 2)
- log_warn("Any newly written data will be non-resilient on LV %s during the split!",
+ log_warn("WARNING: Any newly written data will be non-resilient on LV %s during the split!",
display_lvname(lv));
log_print_unless_silent("Use 'lvconvert --merge %s' to merge back into %s.",
6 years, 10 months
master - cleanup: improve debug tracing
by Zdenek Kabelac
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=14816222a19c01e3846...
Commit: 14816222a19c01e3846d8a38f89113613ae531e8
Parent: b7c9ec8a24a0271e55ea5aa0c9f6525011d0fa0c
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Wed Jun 14 16:26:35 2017 +0200
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Fri Jun 16 17:04:02 2017 +0200
cleanup: improve debug tracing
---
lib/metadata/raid_manip.c | 27 +++++++++++++--------------
1 files changed, 13 insertions(+), 14 deletions(-)
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
index 214aa19..87b6c01 100644
--- a/lib/metadata/raid_manip.c
+++ b/lib/metadata/raid_manip.c
@@ -442,7 +442,7 @@ static int _raid_remove_top_layer(struct logical_volume *lv,
if (!(lvl_array = dm_pool_alloc(lv->vg->vgmem, 2 * sizeof(*lvl)))) {
log_error("Memory allocation failed.");
- return_0;
+ return 0;
}
/* Add last metadata area to removal_lvs */
@@ -545,11 +545,13 @@ static int _lv_update_reload_fns_reset_eliminate_lvs(struct logical_volume *lv,
fn_pre_data = va_arg(ap, void *);
}
+ va_end(ap);
+
/* Call any fn_pre_on_lv before the first update and reload call (e.g. to rename LVs) */
/* returns 1: ok+ask caller to update, 2: metadata commited+ask caller to resume */
if (fn_pre_on_lv && !(r = fn_pre_on_lv(lv, fn_pre_data))) {
log_error(INTERNAL_ERROR "Pre callout function failed.");
- goto err;
+ return 0;
}
if (r == 2) {
@@ -560,16 +562,16 @@ static int _lv_update_reload_fns_reset_eliminate_lvs(struct logical_volume *lv,
if (!(r = (origin_only ? resume_lv_origin(lv->vg->cmd, lv_lock_holder(lv)) :
resume_lv(lv->vg->cmd, lv_lock_holder(lv))))) {
log_error("Failed to resume %s.", display_lvname(lv));
- goto err;
+ return 0;
}
/* Update metadata and reload mappings including flags (e.g. LV_REBUILD, LV_RESHAPE_DELTA_DISKS_PLUS) */
} else if (!(r = (origin_only ? lv_update_and_reload_origin(lv) : lv_update_and_reload(lv))))
- goto err;
+ return_0;
/* Eliminate any residual LV and don't commit the metadata */
if (!(r = _eliminate_extracted_lvs_optional_write_vg(lv->vg, removal_lvs, 0)))
- goto err;
+ return_0;
/*
* Now that any 'REBUILD' or 'RESHAPE_DELTA_DISKS' etc.
@@ -582,25 +584,22 @@ static int _lv_update_reload_fns_reset_eliminate_lvs(struct logical_volume *lv,
*/
log_debug_metadata("Clearing any flags for %s passed to the kernel.", display_lvname(lv));
if (!(r = _reset_flags_passed_to_kernel(lv, &flags_reset)))
- goto err;
+ return_0;
/* Call any @fn_post_on_lv before the second update call (e.g. to rename LVs back) */
if (fn_post_on_lv && !(r = fn_post_on_lv(lv, fn_post_data))) {
log_error("Post callout function failed.");
- goto err;
+ return 0;
}
/* Update and reload to clear out reset flags in the metadata and in the kernel */
log_debug_metadata("Updating metadata mappings for %s.", display_lvname(lv));
if ((r != 2 || flags_reset) && !(r = (origin_only ? lv_update_and_reload_origin(lv) : lv_update_and_reload(lv)))) {
log_error(INTERNAL_ERROR "Update of LV %s failed.", display_lvname(lv));
- goto err;
+ return 0;
}
- r = 1;
-err:
- va_end(ap);
- return r;
+ return 1;
}
/*
@@ -4030,14 +4029,14 @@ static int _convert_raid1_to_mirror(struct logical_volume *lv,
/* Remove rmeta LVs */
log_debug_metadata("Extracting and renaming metadata LVs.");
if (!_extract_image_component_list(seg, RAID_META, 0, removal_lvs))
- return 0;
+ return_0;
seg->meta_areas = NULL;
/* Rename all data sub LVs from "*_rimage_*" to "*_mimage_*" and set their status */
log_debug_metadata("Adjust data LVs of %s.", display_lvname(lv));
if (!_adjust_data_lvs(lv, RAID1_TO_MIRROR))
- return 0;
+ return_0;
seg->segtype = new_segtype;
seg->region_size = new_region_size;
6 years, 10 months