master - blkdeactivate: cleanup
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b0f4e0fcec1a50b73fbc4f05bfd2d385895bc3bc Commit: b0f4e0fcec1a50b73fbc4f05bfd2d385895bc3bc Parent: bdccab07f94f6b2e464e2d43d1f91dbb0a9fb2e0 Author: Peter Rajnoha <[email protected]> AuthorDate: Fri Sep 22 11:10:57 2017 +0200 Committer: Peter Rajnoha <[email protected]> CommitterDate: Fri Sep 22 11:10:57 2017 +0200
blkdeactivate: cleanup
Use a different variable for translated name in dm/md_deactivate fn Fix dmraidoption/dmraidoptions in man page.
--- man/blkdeactivate.8_main | 2 +- scripts/blkdeactivate.sh.in | 20 +++++++++++--------- 2 files changed, 12 insertions(+), 10 deletions(-)
man/blkdeactivate.8_main +1 -1
@@ -63,7 +63,7 @@ all the paths are unavailable for any underlying device-mapper multipath device. .RE .TP -.BR -r ", " --mdraidoption \ \fImdraid_options\fP +.BR -r ", " --mdraidoptions \ \fImdraid_options\fP Comma-separated list of MD RAID specific options: .RS .IP \fIwait\fP
scripts/blkdeactivate.sh.in +11 -9
@@ -211,14 +211,15 @@ deactivate_holders () { } deactivate_dm () { - local name=$(printf "%s" "$name") - test -b "$DEV_DIR/mapper/$name" || return 0 + local xname + xname=$(printf "%s" "$name") + test -b "$DEV_DIR/mapper/$xname" || return 0 test -z "${SKIP_DEVICE_LIST["$kname"]}" || return 1 - deactivate_holders "$DEV_DIR/mapper/$name" || return 1 + deactivate_holders "$DEV_DIR/mapper/$xname" || return 1 - echo -n " [DM]: deactivating $devtype device $name ($kname)... " - if eval "$DMSETUP" $DMSETUP_OPTS remove "$name" "$OUT" "$ERR"; then + echo -n " [DM]: deactivating $devtype device $xname ($kname)... " + if eval "$DMSETUP" $DMSETUP_OPTS remove "$xname" "$OUT" "$ERR"; then echo "done" else echo "skipping"
@@ -280,9 +281,10 @@ deactivate_lvm () { } deactivate_md () { - local name=$(printf "%s" "$name") + local xname + xname=$(printf "%s" "$name") local sync_action - test -b "$DEV_DIR/$name" || return 0 + test -b "$DEV_DIR/$xname" || return 0 test -z "${SKIP_DEVICE_LIST["$kname"]}" || return 1 # Skip MD device deactivation if MD tools missing.
@@ -291,7 +293,7 @@ deactivate_md () { return 1 } - deactivate_holders "$DEV_DIR/$name" || return 1 + deactivate_holders "$DEV_DIR/$xname" || return 1 echo -n " [MD]: deactivating $devtype device $kname... "
@@ -307,7 +309,7 @@ deactivate_md () { } } - if eval "$MDADM" $MDADM_OPTS -S "$name" "$OUT" "$ERR"; then + if eval "$MDADM" $MDADM_OPTS -S "$xname" "$OUT" "$ERR"; then echo "done" else echo "skipping"