From patchwork Fri Oct 23 15:01:34 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Snitzer X-Patchwork-Id: 55556 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 n9NF1cd5002871 for ; Fri, 23 Oct 2009 15:01:38 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 ADDC9619B13; Fri, 23 Oct 2009 11:01:37 -0400 (EDT) Received: from int-mx05.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 n9NF1ZOY007353 for ; Fri, 23 Oct 2009 11:01:35 -0400 Received: from localhost (dhcp-100-19-150.bos.redhat.com [10.16.19.150]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9NF1ZFL019364; Fri, 23 Oct 2009 11:01:35 -0400 Date: Fri, 23 Oct 2009 11:01:34 -0400 From: Mike Snitzer To: dm-devel@redhat.com Message-ID: <20091023150134.GA25363@redhat.com> References: <1256078825-11331-1-git-send-email-snitzer@redhat.com> <1256078825-11331-5-git-send-email-snitzer@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1256078825-11331-5-git-send-email-snitzer@redhat.com> User-Agent: Mutt/1.5.20 (2009-08-17) X-Scanned-By: MIMEDefang 2.67 on 10.5.11.18 X-loop: dm-devel@redhat.com Cc: Mikulas Patocka , Alasdair G Kergon Subject: [dm-devel] Re: [PATCH v2 04/17] dm snapshot: exception handover improvements 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 fca2479..e0330e3 100644 --- a/drivers/md/dm-snap.c +++ b/drivers/md/dm-snap.c @@ -982,13 +982,13 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) } /* cross reference snapshots that will do handover */ + down_write(&dup->lock); dup->handover_snap = s; + up_write(&dup->lock); s->handover_snap = dup; + /* this new snapshot will accept the handover */ s->handover = 1; - } else if (is_merge(ti)) { - ti->error = "Unable to find snapshot that is to be merged"; - goto bad_load_and_register; } /* Metadata must only be loaded into one table at once */