From: Mike Snitzer <snitzer@redhat.com>
To: Alasdair G Kergon <agk@redhat.com>
Cc: dm-devel@redhat.com, Mikulas Patocka <mpatocka@redhat.com>
Subject: Re: [PATCH v3] dm snapshot: allow live exception store handover between tables
Date: Mon, 9 Nov 2009 22:22:25 -0500 [thread overview]
Message-ID: <20091110032225.GA16580@redhat.com> (raw)
In-Reply-To: <1257818350-9872-1-git-send-email-snitzer@redhat.com>
On Mon, Nov 09 2009 at 8:59pm -0500,
Mike Snitzer <snitzer@redhat.com> wrote:
> 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
> @@ -659,7 +796,10 @@ static int snapshot_ctr(struct dm_target
> s->active = 0;
> s->suspended = 0;
> atomic_set(&s->pending_exceptions_count, 0);
> + s->is_handover_destination = 0;
> + s->handover_snap = NULL;
> init_rwsem(&s->lock);
> + INIT_LIST_HEAD(&s->list);
The above s->list initialization was needed to avoid a GPF in
unregister_snapshot() that would occur if handover was skipped by
calling __unlink_snapshots_for_handover().
Skipping handover also implies skipping register_snapshot(). Skipping
register_snapshot() opens us up to new modes of failure in dm-snap.c's
snapshot cleanup paths. One that I missed is the following:
diff --git a/drivers/md/dm-snap.c b/drivers/md/dm-snap.c
index 5e53ee2..1737917 100644
--- a/drivers/md/dm-snap.c
+++ b/drivers/md/dm-snap.c
@@ -386,7 +386,7 @@ static void unregister_snapshot(struct dm_snapshot
*s)
o = __lookup_origin(s->origin->bdev);
list_del(&s->list);
- if (list_empty(&o->snapshots)) {
+ if (o && list_empty(&o->snapshots)) {
list_del(&o->hash_list);
kfree(o);
}
prev parent reply other threads:[~2009-11-10 3:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-10 1:59 [PATCH v3] dm snapshot: allow live exception store handover between tables Mike Snitzer
2009-11-10 3:22 ` Mike Snitzer [this message]
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=20091110032225.GA16580@redhat.com \
--to=snitzer@redhat.com \
--cc=agk@redhat.com \
--cc=dm-devel@redhat.com \
--cc=mpatocka@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.