]> git.ipfire.org Git - thirdparty/mdadm.git/commit - sysfs.c
Make get_component_size() work with named array.
authorNeilBrown <neilb@suse.com>
Thu, 22 Dec 2016 02:14:59 +0000 (13:14 +1100)
committerJes Sorensen <Jes.Sorensen@redhat.com>
Thu, 22 Dec 2016 17:19:10 +0000 (12:19 -0500)
commitc07566f14c89f42b5908bd36d1857d327d1bcc41
treeb8b3059e295bc6f5c58e7804387d3470dc248ecd
parent6df5d1833f52cce0e1925920fdca5f90e6428667
Make get_component_size() work with named array.

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 <robert@leblancnet.us>
Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
sysfs.c