From: Dave Wysochanski <dwysocha@redhat.com>
To: lvm-devel@redhat.com
Subject: [PATCH] Remove LOCK_KEEP and READ_CHECK_EXISTENCE from vgsplit.
Date: Tue, 07 Jul 2009 09:11:54 -0400 [thread overview]
Message-ID: <1246972314.2450.11.camel@f10-node1> (raw)
In-Reply-To: <4A530EF2.9040705@redhat.com>
On Tue, 2009-07-07 at 11:01 +0200, Milan Broz wrote:
> Dave Wysochanski wrote:
> > diff --git a/tools/vgsplit.c b/tools/vgsplit.c
> > index 9cd90b8..0dc5bc4 100644
> > --- a/tools/vgsplit.c
> > +++ b/tools/vgsplit.c
> > @@ -342,11 +342,12 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
> > existing_vg = 1;
> > vg_to = vg_read_for_update(cmd, vg_name_to, NULL,
> > READ_REQUIRE_RESIZEABLE |
> > - LOCK_NONBLOCKING | LOCK_KEEP |
> > - READ_CHECK_EXISTENCE);
> > + LOCK_NONBLOCKING);
> >
> > - if (vg_read_error(vg_to))
> > - goto_bad;
> > + if (vg_read_error(vg_to)) {
>
> but vg_name_to is locked by vg_lock_newname() previously?
> so unlock_and_release here?
>
No - if vg_lock_newname() returns any failure code, it releases the
lock. In this case it is FAILED_EXIST.
> also now code missing stack; (note goto_bad before)
>
Right - good catch.
> > + vg_release(vg_to);
> > + goto bad2;
> > + }
> >
>
>
> Milan
>
> --
> lvm-devel mailing list
> lvm-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/lvm-devel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Remove-LOCK_KEEP-and-READ_CHECK_EXISTENCE-from-vgspl.patch
Type: text/x-patch
Size: 1676 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/lvm-devel/attachments/20090707/261d7dbd/attachment.bin>
next prev parent reply other threads:[~2009-07-07 13:11 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-07 4:24 [PATCH 0/4]: Remove unnecessary flags from new vg_read() APIs and tools Dave Wysochanski
2009-07-07 4:24 ` [PATCH] Remove LOCK_KEEP and READ_CHECK_EXISTENCE from vgsplit Dave Wysochanski
2009-07-07 4:24 ` [PATCH] Remove unneeded LOCK_KEEP from vg_read() interface Dave Wysochanski
2009-07-07 4:24 ` [PATCH] Remove READ_CHECK_EXISTENCE and vg_might_exist() Dave Wysochanski
2009-07-07 4:24 ` [PATCH] Remove unneeded LOCK_NONBLOCKING from vg_read() API Dave Wysochanski
2009-07-07 9:01 ` [PATCH] Remove LOCK_KEEP and READ_CHECK_EXISTENCE from vgsplit Milan Broz
2009-07-07 13:11 ` Dave Wysochanski [this message]
2009-07-07 21:17 ` [PATCH 0/4]: Remove unnecessary flags from new vg_read() APIs and tools Alasdair G Kergon
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=1246972314.2450.11.camel@f10-node1 \
--to=dwysocha@redhat.com \
--cc=lvm-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.