t/zbd: Fix a bug in reset_zone() for all zones reset
authorShin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Mon, 13 Apr 2020 08:32:59 +0000 (17:32 +0900)
committerJens Axboe <axboe@kernel.dk>
Mon, 13 Apr 2020 14:22:12 +0000 (08:22 -0600)
The bash function reset_zone() is expected to reset all zones when -1 is
provided as its second argument. However, it fails to reset all zones
using blkzone command because of wrong and unnecessary options provided
to blkzone. Remove the option to fix it.

This failure was found with running test-zbd-support with -r option.

Reviewed-by: Damien Le Moal <damien.lemoaal@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
t/zbd/functions

index 5bffad6ee53af69857b2b076d2f7b09f14d0437f..1bd22ec4259ddbcc86c5aa397d06ffe7fd21d7a6 100644 (file)
@@ -97,8 +97,7 @@ reset_zone() {
 
     if [ -n "${blkzone}" ] && [ ! -n "${use_libzbc}" ]; then
        if [ "$offset" -lt 0 ]; then
-           sectors=$(<"/sys/class/block/${dev#/dev/}/size")
-           ${blkzone} reset -o "${offset}" -l "$sectors" "$dev"
+           ${blkzone} reset "$dev"
        else
            ${blkzone} reset -o "${offset}" -c 1 "$dev"
        fi