summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2020-02-03 15:59:12 -0600
committerDavid Teigland <teigland@redhat.com>2020-02-03 15:59:12 -0600
commitc1ee6f0eef24a44cc02ec941f560bc17ac61b3d8 (patch)
treee12b2495e35bcb80063ddf227d7fd9147699b3eb
parent379a7e1288a5e7a15cd2872c074b219992575b4d (diff)
downloadlvm2-c1ee6f0eef24a44cc02ec941f560bc17ac61b3d8.tar.gz
pvmove: prevent moving writecache device
-rw-r--r--tools/pvmove.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/pvmove.c b/tools/pvmove.c
index 674decfa8..0419a3d64 100644
--- a/tools/pvmove.c
+++ b/tools/pvmove.c
@@ -376,6 +376,11 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
return NULL;
}
+ if (lv_is_writecache_cachevol(lv)) {
+ log_error("Unable to pvmove device used for writecache.");
+ return NULL;
+ }
+
seg = first_seg(lv);
if (!needs_exclusive) {
/* Presence of exclusive LV decides whether pvmove must be also exclusive */
@@ -615,6 +620,11 @@ static int _pvmove_setup_single(struct cmd_context *cmd,
log_error("Logical volume %s not found.", lv_name);
return ECMD_FAILED;
}
+
+ if (lv_is_writecache(lv)) {
+ log_error("pvmove not allowed on LV using writecache.");
+ return ECMD_FAILED;
+ }
}
/*