]> git.ipfire.org Git - thirdparty/mdadm.git/commit - sysfs.c
sysfs: include faulty drive in disk count
authorMariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Tue, 7 Nov 2017 15:49:56 +0000 (16:49 +0100)
committerJes Sorensen <jsorensen@fb.com>
Thu, 9 Nov 2017 20:45:52 +0000 (15:45 -0500)
commitfe05dc43d81e0c91cc84498e7229008748986b71
treea28c035f429f9b8c002ab92eed576ed62658f2b0
parentcca672081e7f03d2763fdc7915379d37d581ad8b
sysfs: include faulty drive in disk count

When the disk fails, it goes into faulty state first and it is removed
from the array in a while. It gives mdadm monitor a chance to see the disk
has failed and notify an event (e.g. FailSpare). It doesn't work when
sysfs is used to get a number of disks in the array as it skips faulty
disk. ioctl implementation doesn't differentiate between active and
faulty disk. Do the same for sysfs then. It should not matter that number
of disks reported is greater than list of disk structures returned by the
call because the same approach already takes place for offline disks.

Signed-off-by: Mariusz Tkaczyk <mariusz.tkaczyk@intel.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
sysfs.c