From: Shin'ichiro Kawasaki Date: Mon, 13 Apr 2020 08:32:58 +0000 (+0900) Subject: t/zbd: Fix a bug in max_open_zones() X-Git-Tag: fio-3.20~33 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=e80190b4d71199b3508f06509ac978539b3f76b6 t/zbd: Fix a bug in max_open_zones() When sg_inq command is executed to check if it can provide maximum open zones, the command's standard output was not discarded and caused unexpected script behavior. Fix it discarding the standard output. Reviewed-by: Damien Le Moal Signed-off-by: Shin'ichiro Kawasaki Signed-off-by: Jens Axboe --- diff --git a/t/zbd/functions b/t/zbd/functions index 35087b15..5bffad6e 100644 --- a/t/zbd/functions +++ b/t/zbd/functions @@ -43,7 +43,8 @@ max_open_zones() { local dev=$1 if [ -n "${sg_inq}" ] && [ ! -n "${use_libzbc}" ]; then - if ! ${sg_inq} -e --page=0xB6 --len=20 --hex "$dev" 2> /dev/null; then + if ! ${sg_inq} -e --page=0xB6 --len=20 --hex "$dev" \ + > /dev/null 2>&1; then # Non scsi device such as null_blk can not return max open zones. # Use default value. echo 128