block-drbd: Fix block-drbd remove command
PATCH 1/1 block-drbd: Fix block-drbd remove command
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.
--- scripts/block-drbd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/block-drbd +1 -1
@@ -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)"
Signature · 1 line
2.12.0
Quoted 21 lines · Nick Wang
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 <[email protected]>Signed-off-by Nick Wang <[email protected]>CC Lars Ellenberg <[email protected]>CC Roland Kammerer <[email protected]>--- scripts/block-drbd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)scripts/block-drbd +0
-0
scripts/block-drbd case "$command" in · line 290
Quoted 8 lines
scripts/block-drbd +1
-1@@ -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
Quoted 1 line
Quoted 1 line
Quoted 1 line
On 2017-8-11 at 15:45, in message <[email protected]>, Roland
Quoted 17 lines · Kammerer
Quoted 16 lines · Nick Wang
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 <[email protected]>Signed-off-by Nick Wang <[email protected]>CC Lars Ellenberg <[email protected]>CC Roland Kammerer <[email protected]>--- scripts/block-drbd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 15 lines
scripts/block-drbd case "$command" in · line 290
Quoted 13 lines
scripts/block-drbd +1
-1@@ -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