[lvm-devel] [PATCH] Remove LOCK_KEEP and READ_CHECK_EXISTENCE from vgsplit.
Dave Wysochanski
dwysocha at redhat.com
Tue Jul 7 13:11:54 UTC 2009
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>
More information about the lvm-devel
mailing list