]> sourceware.org Git - lvm2.git/commitdiff
writecache: don't pvmove device used by writecache
authorDavid Teigland <teigland@redhat.com>
Wed, 2 Jun 2021 16:12:20 +0000 (11:12 -0500)
committerDavid Teigland <teigland@redhat.com>
Wed, 2 Jun 2021 16:12:20 +0000 (11:12 -0500)
The existing check didn't cover the unusual case where the
cachevol exists on the same device as the origin LV.

tools/pvmove.c

index da635a662d4c2793ac2a17b476d56b6a9b7b388d..bb372f7dcaeb6741d708e362c4bd09931fb75a1d 100644 (file)
@@ -387,6 +387,15 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
                        return NULL;
                }
 
+               if (lv_is_writecache(lv)) {
+                       struct logical_volume *lv_cachevol = first_seg(lv)->writecache;
+                       if (lv_is_on_pvs(lv_cachevol, source_pvl)) {
+                               log_error("Unable to move device used for writecache cachevol %s.", display_lvname(lv_cachevol));
+                               return NULL;
+                       }
+
+               }
+
                if (lv_is_raid(lv) && lv_raid_has_integrity(lv)) {
                        log_error("Unable to pvmove device used for raid with integrity.");
                        return NULL;
This page took 0.038068 seconds and 5 git commands to generate.