]> www.infradead.org Git - users/hch/blktests.git/commitdiff
common/multipath-over-rdma: Fix held_by()
authorBart Van Assche <bvanassche@acm.org>
Fri, 11 Jan 2019 18:43:33 +0000 (10:43 -0800)
committerBart Van Assche <bvanassche@acm.org>
Mon, 11 Feb 2019 16:34:27 +0000 (08:34 -0800)
Use the proper shell operator to remove the /dev/ prefix from a device
path.

Fixes: a7f15d1141e4 ("Add tests for the SRP initiator and target drivers")
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
common/multipath-over-rdma

index 308c9b564abb43e9fea66b06e9083815555e5cf9..8583b58d7a872bc64975e92aa71e3b10aec119d8 100644 (file)
@@ -88,7 +88,7 @@ held_by() {
        while [ -L "$dev" ]; do
                dev=$(realpath "$dev")
        done
-       dev=${dev%/dev/}
+       dev=${dev#/dev/}
        for d in /sys/class/block/*/holders/*; do
                [ -e "$d" ] || continue
                e=$(basename "$d")