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 <damien.lemoaal@wdc.com>
Signed-off-by: Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
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