]> sourceware.org Git - lvm2.git/commitdiff
suspend: fix suspend with noflush limitation
authorZdenek Kabelac <zkabelac@redhat.com>
Wed, 6 Apr 2016 08:29:05 +0000 (10:29 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Wed, 6 Apr 2016 09:31:02 +0000 (11:31 +0200)
Commit 844b00958492224c448b30f89ae5532bb6591fd2 tried to move
limit for usage of noflush to 'preload' however this was not
correctly processed.

Intead explicitly check for which types we do not want noflush
and also add debug message in this case.

lib/activate/activate.c
lib/activate/dev_manager.c

index a3b2379c6622fcfba168f56a62655ee716624e05..7afb4397a29bdbed7826900e038adb39d8c22e8f 100644 (file)
@@ -1933,6 +1933,16 @@ static int _lv_suspend(struct cmd_context *cmd, const char *lvid_s,
                }
        }
 
+       /* Flush is ATM required for the tested cases
+        * NOTE: Mirror repair requires noflush for proper repair!
+        * TODO: Relax this limiting condition further */
+       if (!flush_required &&
+           (lv_is_pvmove(lv) ||
+            (!lv_is_mirror(lv) && !lv_is_thin_pool(lv) && !lv_is_thin_volume(lv)))) {
+               log_debug("Requiring flush for LV %s.", display_lvname(lv));
+               flush_required = 1;
+       }
+
        if (!monitor_dev_for_events(cmd, lv, laopts, 0))
                /* FIXME Consider aborting here */
                stack;
index 22331c3b75de70555cbfbc43faecac7761b104f8..994ba809d25bf362f9ae764841aacb01bbeee206 100644 (file)
@@ -3023,7 +3023,7 @@ static int _tree_action(struct dev_manager *dm, const struct logical_volume *lv,
                break;
        case SUSPEND:
                dm_tree_skip_lockfs(root);
-               if (!dm->flush_required && !lv_is_pvmove(lv))
+               if (!dm->flush_required)
                        dm_tree_use_no_flush_suspend(root);
                /* Fall through */
        case SUSPEND_WITH_LOCKFS:
This page took 0.048008 seconds and 5 git commands to generate.