# Re: \[mdadm PATCH\] Make get\_component\_size() work with named array.

- From: Jes Sorensen \<hidden\>
- Date: 2016-12-22 17:19:27 
- List: linux-raid
- Page: https://ratatoskr.run/linux-raid/2016/12/6633996
- Thread: https://ratatoskr.run/linux-raid/2016/12/6633996/t.md

```text
NeilBrown [ref] writes:
> get_component_size() still assumes that all array are
>  /sys/block/md%d or /sys/block/md_d%d
> and so doesn't work with e.g. /sys/block/md_foo.
>
> This cause "mdadm --detail" to report
>    Used Dev Size : unknown
> and causes problems when added spares and in other circumstances.
>
> So change it to use stat2devnm() which does the right thing with all
> types of array names.
>
> Reported-and-tested-by: Robert LeBlanc <redacted>
> Signed-off-by: NeilBrown <redacted>
> ---
>  sysfs.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)

Applied!

Thanks,
Jes
```
