[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [LVM2 PATCH] (2/3) Check cow != origin in vg_add_snapshot() library call



This is a similar check to the previous patches
in library function: vg_add_snapshot().

Thanks,
-- 
Jun'ichi Nomura, NEC Corporation of America
vg_add_snapshot() should not acceept the request where cow == origin.

Index: LVM2.work/lib/metadata/snapshot_manip.c
===================================================================
--- LVM2.work.orig/lib/metadata/snapshot_manip.c
+++ LVM2.work/lib/metadata/snapshot_manip.c
@@ -64,6 +64,11 @@ int vg_add_snapshot(struct format_instan
 		return 0;
 	}
 
+	if (cow == origin) {
+		log_err("snapshot origin is specified as cow store.");
+		return 0;
+	}
+
 	if (!(snap = lv_create_empty(fid, name ? name : "snapshot%d",
 				     lvid, LVM_READ | LVM_WRITE | VISIBLE_LV,
 				     ALLOC_INHERIT, 1, origin->vg))) {

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]