1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

dmsetup: do not treat no groups as an error in dmstats list --group

Analogous to the case of a device with no regions, it is not an
error to attempt to list the stats groups on a device that has no
configured groups: just return success and continue.
This commit is contained in:
Bryn M. Reeves 2019-09-30 17:10:05 +01:00
parent 5c0264d689
commit 8f02f8dcd7

View File

@ -942,10 +942,12 @@ static int _display_info_cols(struct dm_task *dmt, struct dm_info *info)
}
}
/* group report with no groups? */
/* Group report with no groups is not an error */
if ((walk_flags == DM_STATS_WALK_GROUP)
&& !dm_stats_get_nr_groups(obj.stats))
&& !dm_stats_get_nr_groups(obj.stats)) {
r = 1;
goto out;
}
dm_stats_walk_init(obj.stats, walk_flags);
dm_stats_walk_do(obj.stats) {