]> sourceware.org Git - lvm2.git/commitdiff
Use suspend|resume_origin_only when up-converting RAID LVs, as mirrors do.
authorJonathan Earl Brassow <jbrassow@redhat.com>
Tue, 24 Jan 2012 14:33:38 +0000 (14:33 +0000)
committerJonathan Earl Brassow <jbrassow@redhat.com>
Tue, 24 Jan 2012 14:33:38 +0000 (14:33 +0000)
Failure to do so results in "Performing unsafe table load while X device(s) are
known to be suspended" errors.  While fixing the problem in this way works and
is consistent with the way the mirror segment type does it, it would be nice
to find a solution that uses the generic suspend/resume calls.

Also included in this check-in are additions to the test suite that perform
conversions on RAID LVs under a snapshot.  These tests are disabled for the
time being due to a kernel bug that is yet to be tracked down.

WHATS_NEW
lib/metadata/raid_manip.c
test/shell/lvconvert-raid.sh

index 2a2252c9612e364015e516169c853e133558a8d0..3c962fdca98e7898c168c333af36ec493a7036c7 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.89 - 
 ==================================
+  Use suspend|resume_origin_only when up-converting RAID, as mirrors do.
   Fix the way RAID meta LVs are added to the dependency tree.
   Change exclusive LV activation logic to try local node before remote nodes.
   Add CLVMD_FLAG_REMOTE to skip processing on local node.
index 24d07f646d5c70c1df0947d92d41dea65e7294ee..87563f5d4c7e4b97ccb4ac88f84e889c4a3083d6 100644 (file)
@@ -762,7 +762,7 @@ to be left for these sub-lvs.
                return 0;
        }
 
-       if (!suspend_lv(cmd, lv)) {
+       if (!suspend_lv_origin(cmd, lv)) {
                log_error("Failed to suspend %s/%s before committing changes",
                          lv->vg->name, lv->name);
                return 0;
@@ -774,7 +774,7 @@ to be left for these sub-lvs.
                return 0;
        }
 
-       if (!resume_lv(cmd, lv)) {
+       if (!resume_lv_origin(cmd, lv)) {
                log_error("Failed to resume %s/%s after committing changes",
                          lv->vg->name, lv->name);
                return 0;
index 66f533c338f21f5bc53d3f10c6ffdd53c35d3c47..73d1a000ff0dc54947cbad5c1e8e914b4010c380 100644 (file)
@@ -25,10 +25,14 @@ function is_in_sync()
        if ! a=(`dmsetup status $dm_name`); then
                echo "Unable to get sync status of $1"
                exit 1
+       elif [ ${a[2]} = "snapshot-origin" ]; then
+               if ! a=(`dmsetup status ${dm_name}-real`); then
+                       echo "Unable to get sync status of $1"
+                       exit 1
+               fi
        fi
 
        # 6th argument is the sync ratio for RAID and mirror
-       echo ${a[@]}
        if [ ${a[2]} = "raid" ]; then
                # Last argument is the sync ratio for RAID
                idx=$((${#a[@]} - 1))
@@ -103,6 +107,11 @@ aux prepare_vg 5 80
 ###########################################
 # RAID1 convert tests
 ###########################################
+#
+# FIXME: Snapshots of RAID is available, but there are kernel bugs that
+#        still prevent its use.
+#for under_snap in false true; do
+for under_snap in false; do
 for i in 1 2 3 4; do
        for j in 1 2 3 4; do
                if [ $i -eq 1 ]; then
@@ -115,7 +124,13 @@ for i in 1 2 3 4; do
                else
                        to="$j-way"
                fi
-               echo "Converting from $from to $to"
+
+               echo -n "Converting from $from to $to"
+               if $under_snap; then
+                       echo -n " (while under a snapshot)"
+               fi
+               echo
+
                if [ $i -eq 1 ]; then
                        # Shouldn't be able to create with just 1 image
                        not lvcreate --type raid1 -m 0 -l 2 -n $lv1 $vg
@@ -125,6 +140,11 @@ for i in 1 2 3 4; do
                        lvcreate --type raid1 -m $(($i - 1)) -l 2 -n $lv1 $vg
                        wait_for_sync $vg/$lv1
                fi
+
+               if $under_snap; then
+                       lvcreate -s $vg/$lv1 -n snap -l 2
+               fi
+
                lvconvert -m $((j - 1))  $vg/$lv1
 
                # FIXME: ensure no residual devices
@@ -135,7 +155,7 @@ for i in 1 2 3 4; do
                lvremove -ff $vg
        done
 done
-
+done
 #
 # FIXME: Add tests that specify particular devices to be removed
 #
This page took 0.047867 seconds and 5 git commands to generate.