From patchwork Mon Oct 5 19:02:43 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Snitzer X-Patchwork-Id: 51781 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 n95J303J016178 for ; Mon, 5 Oct 2009 19:03:00 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 00E228E08BA; Mon, 5 Oct 2009 15:02:59 -0400 (EDT) Received: from int-mx02.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 n95J2rKt009997 for ; Mon, 5 Oct 2009 15:02:53 -0400 Received: from localhost (dhcp-100-18-171.bos.redhat.com [10.16.18.171]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n95J2qoV011859; Mon, 5 Oct 2009 15:02:53 -0400 From: Mike Snitzer To: dm-devel@redhat.com Date: Mon, 5 Oct 2009 15:02:43 -0400 Message-Id: <1254769367-12111-9-git-send-email-snitzer@redhat.com> In-Reply-To: <1254769367-12111-1-git-send-email-snitzer@redhat.com> References: <1254769367-12111-1-git-send-email-snitzer@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.12 X-loop: dm-devel@redhat.com Cc: Mikulas Patocka Subject: [dm-devel] [PATCH 08/12] dm-snapshot-merge-track-writes 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 diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c index 91c80b7..6a55d75 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -700,7 +700,8 @@ static void snapshot_merge_process(struct dm_snapshot *s) s->merge_write_interlock_n = 1; up_write(&s->lock); - /* !!! FIXME: wait until writes to this chunk drain */ + while (__chunk_is_tracked(s, old_chunk)) + msleep(1); dm_kcopyd_copy(s->kcopyd_client, &src, 1, &dest, 0, merge_callback, s); return; @@ -1446,7 +1447,11 @@ static int snapshot_merge_map(struct dm_target *ti, struct bio *bio, r = DM_MAPIO_SUBMITTED; goto out_unlock; } + remap_exception(s, e, bio, chunk); + + if (bio_rw(bio) == WRITE) + map_context->ptr = track_chunk(s, chunk); goto out_unlock; }