All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2 of 2] DM Snapshot: dont insert before existing chunk
@ 2009-09-23 15:25 Jonathan Brassow
  2009-09-24 12:48 ` Alasdair G Kergon
  0 siblings, 1 reply; 7+ messages in thread
From: Jonathan Brassow @ 2009-09-23 15:25 UTC (permalink / raw)
  To: dm-devel; +Cc: mpatocka, snitzer, agk

Patch name: dm-snapshot-dont-insert-before-existing-chunk.patch

Don't insert into hash before an existing chunk.

Most inserts are after an existing extent anyway so this code is used
very rarely.

The snapshot merge code always pulls the chunk from the end of the
range.  Without introducing unnecessary complexity, snapshot merge can't
pull the exception from the middle of a range --- i.e. if you have range
1-10 and you merge chunk 5, you'd have to split the range into two.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reviewed-by: Jonathan Brassow <jbrassow@redhat.com>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>

Index: linux-2.6/drivers/md/dm-snap.c
===================================================================
--- linux-2.6.orig/drivers/md/dm-snap.c
+++ linux-2.6/drivers/md/dm-snap.c
@@ -478,16 +478,6 @@ static void insert_completed_exception(s
 			return;
 		}
 
-		/* Insert before an existing chunk? */
-		if (new_e->old_chunk == (e->old_chunk - 1) &&
-		    new_e->new_chunk == (dm_chunk_number(e->new_chunk) - 1)) {
-			dm_consecutive_chunk_count_inc(e);
-			e->old_chunk--;
-			e->new_chunk--;
-			free_exception(new_e);
-			return;
-		}
-
 		if (new_e->old_chunk > e->old_chunk)
 			break;
 	}

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2009-09-25  3:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-23 15:25 [PATCH 2 of 2] DM Snapshot: dont insert before existing chunk Jonathan Brassow
2009-09-24 12:48 ` Alasdair G Kergon
2009-09-24 14:10   ` Mikulas Patocka
2009-09-24 14:15     ` Mikulas Patocka
2009-09-24 14:21       ` Mike Snitzer
2009-09-25  3:40       ` Mikulas Patocka
2009-09-25  3:43   ` Mike Snitzer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.