summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2017-01-25 15:10:59 +0000
committerBryn M. Reeves <bmr@redhat.com>2017-01-25 15:29:35 +0000
commit1c00bb5da3a53152c5f9e0c9d3382afdec1b2455 (patch)
treef22c8e76bbacc5387c660a3f7969ca78d6e73017
parentca427a711a33b02264689dcfca4bc5e5d2f9434e (diff)
downloadlvm2-1c00bb5da3a53152c5f9e0c9d3382afdec1b2455.tar.gz
libdm: test for DM_STATS_GROUP_NOT_PRESENT in _stats_group_id_present
If the group_id passed to _stats_group_id_present is equal to the special value DM_STATS_GROUP_NOT_PRESENT there is no need to perform any further tests: return false immediately.
-rw-r--r--libdm/libdm-stats.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index 6e79a0935..f10c6d686 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -261,6 +261,9 @@ static int _stats_group_id_present(const struct dm_stats *dms, uint64_t id)
{
struct dm_stats_group *group = NULL;
+ if (id == DM_STATS_GROUP_NOT_PRESENT)
+ return 0;
+
if (!dms || !dms->regions)
return_0;