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

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