summaryrefslogtreecommitdiff
path: root/device_mapper
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2021-09-10 23:02:09 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2021-09-13 12:34:41 +0200
commit6c4cd7b2f22a86a74f49104926ab96a24755e697 (patch)
treef6cdf53c834e7c1073c31a733e6e704d470917f0 /device_mapper
parent30050769b1490e293d9e0f7ed37d83c3e56bb6b3 (diff)
downloadlvm2-6c4cd7b2f22a86a74f49104926ab96a24755e697.tar.gz
cache: fix parentheses for migration_threshold
When generating table line for cache target line, the estimation of added arguments was incorrectly calculated as the evaluation order of "?" is made after "+". However the result was 'masked' by the Reported-by: Jian Cai jcai19
Diffstat (limited to 'device_mapper')
-rw-r--r--device_mapper/libdm-deptree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/device_mapper/libdm-deptree.c b/device_mapper/libdm-deptree.c
index c759c4e46..4f2d79ee1 100644
--- a/device_mapper/libdm-deptree.c
+++ b/device_mapper/libdm-deptree.c
@@ -2644,7 +2644,7 @@ static int _cache_emit_segment_line(struct dm_task *dmt,
EMIT_PARAMS(pos, " %s", name);
/* Do not pass migration_threshold 2048 which is default */
- EMIT_PARAMS(pos, " %u", (seg->policy_argc + (seg->migration_threshold != 2048) ? 1 : 0) * 2);
+ EMIT_PARAMS(pos, " %u", (seg->policy_argc + ((seg->migration_threshold != 2048) ? 1 : 0)) * 2);
if (seg->migration_threshold != 2048)
EMIT_PARAMS(pos, " migration_threshold %u", seg->migration_threshold);
if (seg->policy_settings)