1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

pvmove: prevent moving writecache device

This commit is contained in:
David Teigland 2020-02-03 15:59:12 -06:00
parent 379a7e1288
commit c1ee6f0eef

View File

@ -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;
}
}
/*