From e80190b4d71199b3508f06509ac978539b3f76b6 Mon Sep 17 00:00:00 2001 From: Shin'ichiro Kawasaki Date: Mon, 13 Apr 2020 17:32:58 +0900 Subject: [PATCH] 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 --- t/zbd/functions | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 -- 2.25.1