Re-order the print flags so they are in the same order as the way they are later
defined, parsed, and printed.
Only print rebuild parameters if they were given on the CTR table line and tally
two params for the rebuild output - not one - in the STATUSTYPE_TABLE output.
Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
@@ -547,9 +549,10 @@ static int raid_status(struct dm_target
case STATUSTYPE_TABLE:
/* The string you would use to construct this array */
for (i = 0; i < rs->md.raid_disks; i++)
- if (rs->dev[i].data_dev &&
+ if ((rs->print_flags & DMPF_REBUILD) &&
+ rs->dev[i].data_dev &&
!test_bit(In_sync, &rs->dev[i].rdev.flags))
- raid_param_cnt++; /* for rebuilds */
+ raid_param_cnt += 2; /* for rebuilds */