[Drbd-dev] [PATCH] block-drbd: Fix block-drbd remove command
Roland Kammerer
roland.kammerer at linbit.com
Fri Aug 11 09:45:57 CEST 2017
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.
Thanks, rck
More information about the drbd-dev
mailing list