[Drbd-dev] [PATCH] block-drbd: Fix block-drbd remove command
Nick Wang
nwang at suse.com
Fri Aug 11 10:08:10 CEST 2017
>>> On 2017-8-11 at 15:45, in message <20170811074557.GD15992 at rck.sh>, Roland
Kammerer <roland.kammerer at linbit.com> wrote:
> On Fri, Aug 11, 2017 at 12:26:10PM +0800, Nick Wang wrote:
> > Similar to a previous fix for the add command, strip any 'drbd:'
> > prefix from the resource identifier read from xenstore. Otherwise
> > the remove command can fail, leaving the resource in Primary role.
> > This presents a data hazard if a VM is migrated to another host,
> > where the resource will also be placed in Primary role.
> >
> > Signed-off-by: Jim Fehlig <jfehlig at suse.com>
> > Signed-off-by: Nick Wang <nwang at suse.com>
> > CC: Lars Ellenberg <lars.ellenberg at linbit.com>
> > CC: Roland Kammerer <roland.kammerer at linbit.com>
> > CC: drbd-dev at lists.linbit.com
> >
> > ---
> > scripts/block-drbd | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/scripts/block-drbd b/scripts/block-drbd
> > index 11ec057f..23364cd6 100755
> > --- a/scripts/block-drbd
> > +++ b/scripts/block-drbd
> > @@ -284,7 +284,7 @@ case "$command" in
> > case $t in
> > drbd|phy)
> > p=$(xenstore_read "$XENBUS_PATH/params")
> > - drbd_resource=$p
> > + drbd_resource=${p#drbd:}
> > drbd_role="$(drbdadm role $drbd_resource)"
> > drbd_lrole="${drbd_role%%/*}"
> > drbd_dev="$(drbdadm sh-dev $drbd_resource)"
>
> I squashed that with your previous one.
Sorry for the miss in the previous patch and thanks for the help.
Best regards,
Nick
More information about the drbd-dev
mailing list