From patchwork Wed Sep 23 15:25:08 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonthan Brassow X-Patchwork-Id: 49555 X-Patchwork-Delegate: agk@redhat.com Received: from hormel.redhat.com (hormel1.redhat.com [209.132.177.33]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n8NFPHKO019697 for ; Wed, 23 Sep 2009 15:25:17 GMT Received: from listman.util.phx.redhat.com (listman.util.phx.redhat.com [10.8.4.110]) by hormel.redhat.com (Postfix) with ESMTP id D4DEA618CD2; Wed, 23 Sep 2009 11:25:10 -0400 (EDT) Received: from int-mx03.intmail.prod.int.phx2.redhat.com (nat-pool.util.phx.redhat.com [10.8.5.200]) by listman.util.phx.redhat.com (8.13.1/8.13.1) with ESMTP id n8NFP9te012640 for ; Wed, 23 Sep 2009 11:25:09 -0400 Received: from hydrogen.msp.redhat.com (hydrogen.msp.redhat.com [10.15.80.1]) by int-mx03.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n8NFP8R5024939 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 23 Sep 2009 11:25:09 -0400 Received: from hydrogen.msp.redhat.com (localhost.localdomain [127.0.0.1]) by hydrogen.msp.redhat.com (8.14.1/8.14.1) with ESMTP id n8NFP8mm029958; Wed, 23 Sep 2009 10:25:08 -0500 Received: (from jbrassow@localhost) by hydrogen.msp.redhat.com (8.14.1/8.14.1/Submit) id n8NFP87C029957; Wed, 23 Sep 2009 10:25:08 -0500 Date: Wed, 23 Sep 2009 10:25:08 -0500 From: Jonathan Brassow Message-Id: <200909231525.n8NFP87C029957@hydrogen.msp.redhat.com> To: dm-devel@redhat.com X-Scanned-By: MIMEDefang 2.67 on 10.5.11.16 X-loop: dm-devel@redhat.com Cc: mpatocka@redhat.com, snitzer@redhat.com, agk@redhat.com Subject: [dm-devel] [PATCH 2 of 2] DM Snapshot: dont insert before existing chunk X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.5 Precedence: junk Reply-To: device-mapper development List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com 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 Reviewed-by: Jonathan Brassow Reviewed-by: Mike Snitzer --- dm-devel mailing list dm-devel@redhat.com https://www.redhat.com/mailman/listinfo/dm-devel 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; }