All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Alasdair G Kergon <agk@redhat.com>
Cc: device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH v2 02/17] dm snapshot: add suspended flag to dm_snapshot
Date: Fri, 13 Nov 2009 09:48:12 -0500	[thread overview]
Message-ID: <20091113144812.GB18455@redhat.com> (raw)
In-Reply-To: <20091105005635.GN13375@agk-dp.fab.redhat.com>

On Wed, Nov 04 2009 at  7:56pm -0500,
Alasdair G Kergon <agk@redhat.com> wrote:

> On Tue, Oct 20, 2009 at 06:46:50PM -0400, Mike Snitzer wrote:
> > Allow the snapshot target to be able to verify its state relative to a
> > requested operation.  Allows for invalid operations to be prevented,
> > e.g. an attempt handover an "old" snapshot's exceptions without it
> > having been suspended first.
>  
> OK - same as we do in dm-raid1.
> 
> But just be aware that:
>         /* This does not get reverted if there's an error later. */
>         dm_table_presuspend_targets(map);
> 
> and so it's not identical to querying the dm_suspended() property directly.

Alasdair,

I think it would be best to drop this patch.  We can accomplish the same
using Mike Anderson's new dm_table_md_suspended:
http://patchwork.kernel.org/patch/59743/

Dropping dm-snapshot-track-suspended-state-in-target.patch requires a
small tweak to
dm-snapshot-allow-live-exception-store-handover-between-tables.patch

The following just illustrates how minimal this change is.  For your
convenience I'll just send v8 of the handover patch that includes this
change (and it will also bump the snapshot target's version now that
dm-snapshot-track-suspended-state-in-target.patch is out of the
picture).
---

diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index fce0c39..1543932 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -1325,6 +1325,7 @@ static int snapshot_preresume(struct dm_target *ti)
 			up_write(&snap_src->lock);
 			goto normal_snapshot;
 		}
+		up_write(&snap_src->lock);
 		if (s == snap_src) {
 			/* handover source must not resume before destination */
 			DMERR("Unable to handover exceptions on "
@@ -1334,13 +1335,12 @@ static int snapshot_preresume(struct dm_target *ti)
 			r = -EINVAL;
 		} else {
 			/* if handover-destination, source must be suspended */
-			if (!snap_src->suspended) {
+			if (!dm_table_md_suspended(snap_src->ti->table)) {
 				DMERR("Unable to accept exceptions from a "
 				      "snapshot that is not suspended.");
 				r = -EINVAL;
 			}
 		}
-		up_write(&snap_src->lock);
 	}
 
 normal_snapshot:

  reply	other threads:[~2009-11-13 14:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-20 22:46 [PATCH v2 00/17] snapshot-merge target Mike Snitzer
2009-10-20 22:46 ` [PATCH v2 01/17] dm snapshot: rework writing to snapshot origin Mike Snitzer
2009-10-20 22:46 ` [PATCH v2 02/17] dm snapshot: add suspended flag to dm_snapshot Mike Snitzer
2009-11-05  0:56   ` Alasdair G Kergon
2009-11-13 14:48     ` Mike Snitzer [this message]
2009-11-16 18:17     ` Mike Snitzer
2009-11-17  2:24       ` Alasdair G Kergon
2009-10-20 22:46 ` [PATCH v2 03/17] dm snapshot: initial support for exception handover Mike Snitzer
2009-10-20 22:46 ` [PATCH v2 04/17] dm snapshot: exception handover improvements Mike Snitzer
2009-10-23 15:01   ` Mike Snitzer
2009-10-20 22:46 ` [PATCH v2 05/17] dm exception store: do not read metadata if going to handover exceptions Mike Snitzer
2009-10-20 22:46 ` [PATCH v2 06/17] dm exception store: add snapshot-merge specific methods Mike Snitzer
2009-10-20 22:46 ` [PATCH v2 07/17] dm exception store: snapshot-merge usage accounting Mike Snitzer
2009-10-20 22:46 ` [PATCH v2 08/17] dm snapshot: add snapshot-merge target Mike Snitzer
2009-10-20 22:46 ` [PATCH v2 09/17] dm snapshot: merge target should not allocate new exceptions Mike Snitzer
2009-10-20 22:46 ` [PATCH v2 10/17] dm snapshot: do not allow more than one merging snapshot Mike Snitzer
2009-10-20 22:46 ` [PATCH v2 11/17] dm snapshot: the merge procedure Mike Snitzer
2009-10-20 22:47 ` [PATCH v2 12/17] dm snapshot: queue writes to an area that is actively being merged Mike Snitzer
2009-10-20 22:47 ` [PATCH v2 13/17] dm snapshot: do not merge a chunk until active writes to it finish Mike Snitzer
2009-10-20 22:47 ` [PATCH v2 14/17] dm snapshot: make exceptions in other snapshots when merging Mike Snitzer
2009-10-20 22:47 ` [PATCH v2 15/17] dm snapshot: make exceptions if merge is dispatching to origin Mike Snitzer
2009-10-20 22:47 ` [PATCH v2 16/17] dm snapshot: redirect accesses to origin if merging snap invalidated Mike Snitzer
2009-10-20 22:47 ` [PATCH v2 17/17] dm snapshot: merge a linear region of chunks using one large IO Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20091113144812.GB18455@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.