I agree with you that for operational raid since there would not
be any faulty disks, active disks should the number of disks. However, I
am just concerned that active disks tracks live disks (not failed
disks). If we ever used these commands when the system has faulty drive,
the information returned wouldn't be correct. Though, from XFS
perspective, I can't think of where it can happen.
I would still say that lets rely more on raid_disks to be more
conservative, just my choice.
I'm not that au fait with RAID and md, but looking at what you wrote,
Shailendra, and the md code, instead of your suggestions
(what I think are your suggestions:) of:
(1) subtracting parity from md.raid_disk (instead of md.nr_disks)
where we work out parity by switching on md.level
(2) using directly: (md.nr_disks - md.spares);
that instead we could use:
(3) using directly: md.active_disks
*swidth = *sunit * md.active_disks;
I presume that active is the working non spares and non-parity.
Does that make sense?