[dm-devel] [PATCH] 2.6.0-t6-mm1-dm2: 5/7: Check pe->started flag

Kevin Corry kevcorry at us.ibm.com
Mon Oct 20 13:34:01 UTC 2003


Need to check the pe->started flag before calling start_copy(), or chunks may
be copied multiple times.

--- a/drivers/md/dm-snapshot.c	2003-10-20 12:21:30.000000000 -0500
+++ b/drivers/md/dm-snapshot.c	2003-10-20 12:10:36.000000000 -0500
@@ -1055,19 +1055,12 @@
 			down_write(&pe->snap->lock);
 			if (first)
 				queue_bio(&pe->origin_bios, bio);
-
-#if 0
 			if (!pe->started) {
 				pe->started = 1;
 				up_write(&pe->snap->lock);
 				start_copy(pe);
 			} else
 				up_write(&pe->snap->lock);
-#else
-			pe->started = 1;
-			up_write(&pe->snap->lock);
-			start_copy(pe);
-#endif
 			first = 0;
 			pe = list_entry(pe->siblings.next,
 					struct pending_exception, siblings);





More information about the dm-devel mailing list