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

Kevin Corry corryk at us.ibm.com
Tue Mar 25 14:09:02 UTC 2003


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");




More information about the dm-devel mailing list