Bug 1647567
| Summary: | dmstats list --group "Command failed." | ||
|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Corey Marthaler <cmarthal> |
| Component: | lvm2 | Assignee: | Bryn M. Reeves <bmr> |
| lvm2 sub component: | dmsetup | QA Contact: | cluster-qe <cluster-qe> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | low | ||
| Priority: | medium | CC: | agk, heinzm, jbrassow, mcsontos, msnitzer, prajnoha, prockai, tborcin, zkabelac |
| Version: | 7.6 | ||
| Target Milestone: | rc | ||
| Target Release: | --- | ||
| Hardware: | x86_64 | ||
| OS: | Linux | ||
| Whiteboard: | |||
| Fixed In Version: | lvm2-2.02.186-3.el7 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2020-03-31 20:04:48 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Corey Marthaler
2018-11-07 19:44:17 UTC
This is because _display_info_cols() is returning zero in the case of a device that has at least one region present, but no groups, when the walk flags are set to DM_STATS_WALK_GROUP (walk groups only):
/* group report with no groups? */
if ((walk_flags == DM_STATS_WALK_GROUP)
&& !dm_stats_get_nr_groups(obj.stats))
goto out;
To reproduce you just need at least one device with one or more regions and no groups:
# dmstats create rhel/root
rhel-root: Created new region with 1 area(s) as region ID 0
# dmstats list --group
Command failed.
The fix is to correctly set r=1 before jumping to 'out' in _display_info_cols() (as we already do in the case of there being no regions to report):
/* group report with no groups? */
if ((walk_flags == DM_STATS_WALK_GROUP)
&& !dm_stats_get_nr_groups(obj.stats)) {
r = 1;
goto out;
}
Fixed in master & stable-2.02:
Author: Bryn M. Reeves <bmr>
Date: Mon Sep 30 17:10:05 2019 +0100
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 appears fixed again in the latest rpms. 3.10.0-1109.el7.x86_64 lvm2-2.02.186-3.el7 BUILT: Fri Nov 8 07:07:01 CST 2019 lvm2-libs-2.02.186-3.el7 BUILT: Fri Nov 8 07:07:01 CST 2019 lvm2-cluster-2.02.186-3.el7 BUILT: Fri Nov 8 07:07:01 CST 2019 lvm2-lockd-2.02.186-3.el7 BUILT: Fri Nov 8 07:07:01 CST 2019 lvm2-python-boom-0.9-20.el7 BUILT: Tue Sep 24 06:18:20 CDT 2019 cmirror-2.02.186-3.el7 BUILT: Fri Nov 8 07:07:01 CST 2019 device-mapper-1.02.164-3.el7 BUILT: Fri Nov 8 07:07:01 CST 2019 device-mapper-libs-1.02.164-3.el7 BUILT: Fri Nov 8 07:07:01 CST 2019 device-mapper-event-1.02.164-3.el7 BUILT: Fri Nov 8 07:07:01 CST 2019 device-mapper-event-libs-1.02.164-3.el7 BUILT: Fri Nov 8 07:07:01 CST 2019 device-mapper-persistent-data-0.8.5-1.el7 BUILT: Mon Jun 10 03:58:20 CDT 2019 [root@hayes-01 ~]# dmstats report Name GrpID RgID ObjType ArID ArStart ArSize RMrg/s WMrg/s R/s W/s RSz/s WSz/s AvgRqSz QSize Util% AWait RdAWait WrAWait hayes-01_load 0 0 area 0 48.00m 977.00k 0.00 0.00 0.00 40.00 0 9.54m 244.00k 0.68 22.10 17.02 0.00 17.02 black_bird-synced_primary_raid1_2legs_1 - 1 area 0 0 500.00m 0.00 0.00 0.00 170.00 0 13.62m 82.00k 3.10 100.00 18.26 0.00 18.26 hayes-01_load 0 0 group 0 48.00m 977.00k 0.00 0.00 0.00 40.00 0 9.54m 244.00k 0.68 22.10 17.02 0.00 17.02 [root@hayes-01 ~]# dmstats list --group Name GrpID RgID ObjType RgStart RgSize #Areas ArSize ProgID hayes-01_load 0 0 group 48.00m 977.00k 1 977.00k dmstats Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2020:1129 |