Blame SOURCES/lvm2-2_03_13-writecache-don-t-pvmove-device-used-by-writecache.patch

d16add
 tools/pvmove.c | 9 +++++++++
d16add
 1 file changed, 9 insertions(+)
d16add
d16add
diff --git a/tools/pvmove.c b/tools/pvmove.c
d16add
index da635a6..bb372f7 100644
d16add
--- a/tools/pvmove.c
d16add
+++ b/tools/pvmove.c
d16add
@@ -387,6 +387,15 @@ static struct logical_volume *_set_up_pvmove_lv(struct cmd_context *cmd,
d16add
 			return NULL;
d16add
 		}
d16add
 
d16add
+		if (lv_is_writecache(lv)) {
d16add
+			struct logical_volume *lv_cachevol = first_seg(lv)->writecache;
d16add
+			if (lv_is_on_pvs(lv_cachevol, source_pvl)) {
d16add
+				log_error("Unable to move device used for writecache cachevol %s.", display_lvname(lv_cachevol));
d16add
+				return NULL;
d16add
+			}
d16add
+
d16add
+		}
d16add
+
d16add
 		if (lv_is_raid(lv) && lv_raid_has_integrity(lv)) {
d16add
 			log_error("Unable to pvmove device used for raid with integrity.");
d16add
 			return NULL;