]> git.ipfire.org Git - thirdparty/mdadm.git/commit - super-intel.c
handle disk failures
authorDan Williams <dan.j.williams@intel.com>
Thu, 15 May 2008 06:48:49 +0000 (16:48 +1000)
committerNeil Brown <neilb@suse.de>
Thu, 15 May 2008 06:48:49 +0000 (16:48 +1000)
commit8d45d1969bc299040201df82c51f7fbbc985c401
treeaaa4a6f63d3dd1682388d48f293b892b0d6c0567
parentc2a1e7dad7a2ca88bd6667f8ad0853a62fe8f874
handle disk failures

From: Dan Williams <dan.j.williams@intel.com>

Added curr_state as a parameter to set_disk.  Handlers look at this to
record components failures, and set global 'degraded' or 'failed'
status.

When reading the state as faulty:
1/ mark the disk failed in the metadata

2/ write '-blocked' to the rdev state to allow the kernel's failure
   mechanism to advance

3/ the kernel will take away the drive's role in remove_and_add_spares()

4/ once the disk no longer has a role writing 'remove' to the rdev state
   will get the disk out of array.

There is a window after writing '-blocked' where the kernel will return
-EBUSY to remove requests.  We rely on the fact that the disk will
continue to show faulty so we lazily wait until the kernel is ready to
remove the disk.  If the manager thread needs to get the disk out of the
way it can ping the monitor and wait, just like the replace_array()
case.

[buglet fix: swap the parameters of attr_match in read_dev_state]

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
mdadm.h
monitor.c
super-ddf.c
super-intel.c