From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: dm-devel@redhat.com, Alasdair G Kergon <agk@redhat.com>
Subject: Re: [PATCH v9] dm snapshot: allow live exception store handover between tables
Date: Fri, 20 Nov 2009 13:24:04 -0500 [thread overview]
Message-ID: <20091120182404.GA9458@redhat.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0911201257140.2777@hs20-bc2-1.build.redhat.com>
On Fri, Nov 20 2009 at 1:00pm -0500,
Mikulas Patocka <mpatocka@redhat.com> wrote:
>
>
> On Thu, 19 Nov 2009, Mike Snitzer wrote:
>
> > Permit in-use snapshot exception data to be 'handed over' from one
> > snapshot instance to another. This is a pre-requisite for patches
> > that allow the changes made in a snapshot device to be merged back into
> > its origin device and also allows device resizing.
> >
> > The basic call sequence is:
> >
> > dmsetup load new_snapshot (referencing the existing in-use cow device)
> > - the ctr code detects that the cow is already in use and allows the
> > two snapshot target instances to be linked together
> > dmsetup suspend original_snapshot
> > dmsetup resume new_snapshot
> > - the new_snapshot becomes live, and if anything now tries to access
> > the original one it will receive -EIO
> > dmsetup remove original_snapshot
> >
> > (There can only be two snapshot targets referencing the same cow device
> > simultaneously.)
> >
> > Signed-off-by: Mike Snitzer <snitzer@redhat.com>
>
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> Acked-by: Mikulas Patocka <mpatocka@redhat.com>
>
> > + down_read(&_origins_lock);
> > + (void) __find_snapshots_sharing_cow(s, &snap_src, &snap_dest);
> > + if (snap_src && snap_dest) {
> > + down_write_nested(&snap_src->lock, SINGLE_DEPTH_NESTING);
> > + down_write(&snap_dest->lock);
>
> I'd suggest to use the "_nested" version for the nested lock, it is a
> convention.
>
> down_write(&snap_src->lock);
> down_write_nested(&snap_dest->lock, SINGLE_DEPTH_NESTING);
OK, I've tested this to work fine. Thanks for spotting this.
Alasdair, are you OK with editing v9 of this patch to include Mikulas'
change? And also add his 'Signed-off-by'?
Or should I send v10?
Mike
prev parent reply other threads:[~2009-11-20 18:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-11-19 17:43 [PATCH v9] dm snapshot: allow live exception store handover between tables Mike Snitzer
2009-11-20 18:00 ` Mikulas Patocka
2009-11-20 18:24 ` 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=20091120182404.GA9458@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.