From 9d1b1fb33206387110bee8ab4fef5b4969d460ef Mon Sep 17 00:00:00 2001 From: Karol Latecki Date: Wed, 22 Dec 2021 10:36:07 +0100 Subject: [PATCH] config_converter.py: fix malloc num_blocks arithmetics Use floor division so that operation results in "int" returned. Signed-off-by: Karol Latecki Change-Id: I17126e81102b9f4612efc954213bab9ad55a9395 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/10824 Reviewed-by: Michal Berger Reviewed-by: Konrad Sztyber Reviewed-by: Jim Harris Tested-by: SPDK CI Jenkins --- scripts/config_converter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/config_converter.py b/scripts/config_converter.py index 967070a20e..d3420949a9 100755 --- a/scripts/config_converter.py +++ b/scripts/config_converter.py @@ -186,7 +186,7 @@ def get_malloc_bdev_json(config, section): malloc_json.append({ "params": { "block_size": params[2][3], - "num_blocks": params[1][3] * 1024 * 1024 / params[2][3], + "num_blocks": params[1][3] * 1024 * 1024 // params[2][3], "name": "Malloc%s" % lun }, "method": "bdev_malloc_create"