Commit Graph

7 Commits

Author SHA1 Message Date
Dan Williams 3e70c845e2 add infrastructure to receive higher order commands, like remove_device
From: Dan Williams <dan.j.williams@intel.com>

Each md_message encapsulates a single command.  A command includes an 'action'
member which describes what if any data comes after the action.  Communication
with the monitor involves updating the active_cmd pointer and then writing to
mgr_pipe.  Pass/fail status is returned via mon_pipe.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:54 +10:00
Dan Williams 0af73f61a2 when failures happen they should be propagated to all member arrays
From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:51 +10:00
Dan Williams 8d45d1969b 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>
2008-05-15 16:48:49 +10:00
Dan Williams 2a0bb19e00 Flag arrays for deletion after they have been stopped.
From: Dan Williams <dan.j.williams@intel.com>

If they are later reassembled they will be replaced and deallocated
via replace_array.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:44 +10:00
Dan Williams fd7cde1bf0 handle resync completion
From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:42 +10:00
Dan Williams c052ba301b start resync when transitioning from initial readonly state
From: Dan Williams <dan.j.williams@intel.com>

mdadm handles setting resync_start, monitor uses this value to determine
whether to set the 'active' or 'readauto' state.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:39 +10:00
Neil Brown 549e9569c6 Merge mdmon 2008-05-15 16:48:37 +10:00