]> sourceware.org Git - lvm2.git/commitdiff
Differentiate between snapshot status of "Invalid" and "Merge failed".
authorMike Snitzer <snitzer@redhat.com>
Fri, 20 Jan 2012 22:02:04 +0000 (22:02 +0000)
committerMike Snitzer <snitzer@redhat.com>
Fri, 20 Jan 2012 22:02:04 +0000 (22:02 +0000)
WHATS_NEW
lib/activate/dev_manager.c
lib/misc/lvm-percent.h
lib/report/report.c
lib/snapshot/snapshot.c
liblvm/lvm2app.h
tools/lvconvert.c

index a5e94847e5327fbc2af9d8d917b410fe5f03182e..16723bdda32fd28ea3c600097ebb51845d53624f 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,6 +1,7 @@
 Version 2.02.89 - 
 ==================================
-  Lookup snapshot usage percent of origin when a snapshot is merging.
+  Differentiate between snapshot status of "Invalid" and "Merge failed".
+  Lookup snapshot usage percent of origin volume when a snapshot is merging.
   Update lvdisplay with backward compat. config opt. lvm1_compatible_display.
   Do not report linear segtype for non-striped targets.
   Keep info about creation host and time for each logical volume.
index 497abe5898bf39810abbf6fcdde4960bfc8963b0..41afd028dfe26a710ea6ca4f02a4f41f3c162be2 100644 (file)
@@ -482,6 +482,9 @@ int add_linear_area_to_dtree(struct dm_tree_node *node, uint64_t size, uint32_t
 static percent_range_t _combine_percent(percent_t a, percent_t b,
                                         uint32_t numerator, uint32_t denominator)
 {
+       if (a == PERCENT_MERGE_FAILED || b == PERCENT_MERGE_FAILED)
+               return PERCENT_MERGE_FAILED;
+
        if (a == PERCENT_INVALID || b == PERCENT_INVALID)
                return PERCENT_INVALID;
 
index a9251906a1194f93571c011a6cbad0944bae4b99..bf30a7ef841c01328e884e6d29a9e8da4c8dc914 100644 (file)
@@ -34,7 +34,8 @@ typedef enum {
        PERCENT_0 = 0,
        PERCENT_1 = 1000000,
        PERCENT_100 = 100 * PERCENT_1,
-       PERCENT_INVALID = -1
+       PERCENT_INVALID = -1,
+       PERCENT_MERGE_FAILED = -2
 } percent_range_t;
 
 float percent_to_float(percent_t v);
index 019b39f665bd22f6b8c264f44dd5fa02e93bba90..0c7148e460350132a6f9b2b849a10934fa9862ed 100644 (file)
@@ -836,7 +836,7 @@ static int _snpercent_disp(struct dm_report *rh __attribute__((unused)), struct
        }
 
        if (!lv_snapshot_percent(lv, &snap_percent) ||
-                                (snap_percent == PERCENT_INVALID)) {
+           (snap_percent == PERCENT_INVALID) || (snap_percent == PERCENT_MERGE_FAILED)) {
                if (!lv_is_merging_origin(lv)) {
                        *sortval = UINT64_C(100);
                        dm_report_field_set_value(field, "100.00", sortval);
index ddb9f7f50fdbc6b6c8b441b30274121ab9b29650..662614ce8b3ff2424e3d6d941c0322a9d93a8aaa 100644 (file)
@@ -136,9 +136,11 @@ static int _snap_target_percent(void **target_state __attribute__((unused)),
                        *percent = PERCENT_100;
                else
                        *percent = make_percent(*total_numerator, *total_denominator);
-       } else if (!strcmp(params, "Invalid") ||
-                  !strcmp(params, "Merge failed"))
+       }
+       else if (!strcmp(params, "Invalid"))
                *percent = PERCENT_INVALID;
+       else if (!strcmp(params, "Merge failed"))
+               *percent = PERCENT_MERGE_FAILED;
        else
                return 0;
 
index 317911d9a4ec422e886de3c1fbeb4442cfbd90e6..dd200e3e3a2efb428ce6cd8323e075fb747409d8 100644 (file)
@@ -1591,7 +1591,8 @@ typedef enum {
        PERCENT_0 = 0,
        PERCENT_1 = 1000000,
        PERCENT_100 = 100 * PERCENT_1,
-       PERCENT_INVALID = -1
+       PERCENT_INVALID = -1,
+       PERCENT_MERGE_FAILED = -2
 } percent_range_t;
 
 typedef int32_t percent_t;
index 9553b9bfc943fb52ba21658f8545e876617d85e2..66a25bd4cc14f162afb97803853339f60765f2c2 100644 (file)
@@ -461,6 +461,9 @@ static progress_t _poll_merge_progress(struct cmd_context *cmd,
        } else if (percent == PERCENT_INVALID) {
                log_error("%s: Merging snapshot invalidated. Aborting merge.", lv->name);
                return PROGRESS_CHECK_FAILED;
+       } else if (percent == PERCENT_MERGE_FAILED) {
+               log_error("%s: Merge failed. Retry merge or inspect manually.", lv->name);
+               return PROGRESS_CHECK_FAILED;
        }
 
        if (parms->progress_display)
This page took 0.050014 seconds and 5 git commands to generate.