Don't insert before existing chunk into the hash. This code branch is never used (because exceptions are allocated consecutevely) and if it were used, it would break snapshot merging. Signed-off-by: Mikulas Patocka Index: linux-2.6.26-rc5-devel/drivers/md/dm-snap.c =================================================================== --- linux-2.6.26-rc5-devel.orig/drivers/md/dm-snap.c 2008-06-16 21:39:46.000000000 +0200 +++ linux-2.6.26-rc5-devel/drivers/md/dm-snap.c 2008-06-16 21:47:24.000000000 +0200 @@ -393,16 +393,6 @@ 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; }