diff options
author | Anna Sztukowska <anna.sztukowska@intel.com> | 2024-08-28 12:04:35 +0200 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-08-30 11:15:06 +0200 |
commit | bd5511c792ecc73de8897fbd8713e8c6eaf3e835 (patch) | |
tree | a92a8c4245bad271815d3ea4a977c1ddc8a2020a /Detail.c | |
parent | platform-intel: refactor path_attached_to_hba() (diff) | |
download | mdadm-bd5511c792ecc73de8897fbd8713e8c6eaf3e835.tar.xz mdadm-bd5511c792ecc73de8897fbd8713e8c6eaf3e835.zip |
mdadm: Change displaying of devices in --detail
The counts of active, working, failed and spare devices were not
printed when the number was zero.
Refactor the code to always display the counts of all device types,
regardless of their number. This way, it is more reliable for users.
Signed-off-by: Anna Sztukowska <anna.sztukowska@intel.com>
Diffstat (limited to 'Detail.c')
-rw-r--r-- | Detail.c | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -549,16 +549,10 @@ int Detail(char *dev, struct context *c) } else if (inactive && !is_container) { printf(" State : inactive\n"); } - if (array.raid_disks) - printf(" Active Devices : %d\n", array.active_disks); - if (array.working_disks > 0) - printf(" Working Devices : %d\n", - array.working_disks); - if (array.raid_disks) { - printf(" Failed Devices : %d\n", array.failed_disks); - if (!external) - printf(" Spare Devices : %d\n", array.spare_disks); - } + printf(" Active Devices : %d\n", array.active_disks); + printf(" Working Devices : %d\n", array.working_disks); + printf(" Failed Devices : %d\n", array.failed_disks); + printf(" Spare Devices : %d\n", array.spare_disks); printf("\n"); if (array.level == 5) { str = map_num(r5layout, array.layout); |