summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2021-06-02 11:12:20 -0500
committerMarian Csontos <mcsontos@redhat.com>2021-08-11 13:01:49 +0200
commit4d6035d2a8b9c7bd3eef9ca66c4c4838401e595d (patch)
tree84215de114f1c0a5c0bd8a8918619521fceccef9
parent2b695440c3d08ba0aa0350d45df2607ca0cd3bc6 (diff)
downloadlvm2-4d6035d2a8b9c7bd3eef9ca66c4c4838401e595d.tar.gz
writecache: don't pvmove device used by writecache
The existing check didn't cover the unusual case where the cachevol exists on the same device as the origin LV. (cherry picked from commit e7f107c24666c8577f30e530b74f1ce0347e459b) (cherry picked from commit f15472d5aacfa8f62500edf398bc9d368d64a33f)
-rw-r--r--tools/pvmove.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/tools/pvmove.c b/tools/pvmove.c
index da635a662..bb372f7dc 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -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;