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

[dm-devel] [PATCH] 2.4: dm-exception-store.c: Refuse to activate invalid snapshots



In dm_create_persistent(), when setting up an existing snapshot, if the valid
bit from the snapshot header is not set, refuse to activate the snapshot.

--- linux-2.4.20a/drivers/md/dm-exception-store.c	2003/02/26 14:50:56
+++ linux-2.4.20b/drivers/md/dm-exception-store.c	2003/03/25 19:02:24
@@ -590,6 +590,12 @@
 		/*
 		 * Sanity checks.
 		 */
+		if (!ps->valid) {
+			DMWARN("snapshot is marked invalid");
+			r = -EINVAL;
+			goto bad;
+		}
+
 		if (ps->chunk_size != chunk_size) {
 			DMWARN("chunk size for existing snapshot different "
 			       "from that requested");



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