Commit Graph

722 Commits

Author SHA1 Message Date
Dan Williams 272f648fb0 imsm: write anchor last
Ensure that newly written anchors reflect a consistent metadata block.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-16 15:36:41 -07:00
Dan Williams 551c80c1c1 imsm: implement store_zero_imsm and init_zero_imsm
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-16 15:36:40 -07:00
Dan Williams 4a04ec6ca1 imsm: ->getinfo_super set raid_disk to disk.number
A spare device by definition will have raid_disk set to -1, but when
assembling the container we want this disk to by included.

Fixes a SIGSEGV when doing:
mdadm -A /dev/imsm -e imsm /dev/sd[b-e]

...where /dev/sde is marked as a global spare device

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-16 15:36:40 -07:00
Dan Williams c2c087e631 imsm: add 'Create' support
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-16 15:36:38 -07:00
Dan Williams 8b35327854 imsm: 'volume' is the proper name for imsm container members
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-13 17:42:09 -07:00
Dan Williams f4d11639d1 imsm: ->container_dev needs to be set in load_super_imsm_all
It is used later by container_content_imsm to determine set the
text_version of the member arrays.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-13 17:42:09 -07:00
Dan Williams 87eb16dfa9 imsm: add 'mpb_size' to --examine output
Break out sector_count() for use elsewhere.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-13 17:42:09 -07:00
Dan Williams 90c8b70714 sysfs: provide a helper function for locating scsi_generic interfaces
imsm records and validates this data in its metadata

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-13 17:27:30 -07:00
Neil Brown 2e735d1982 Allow passing metadata update to the monitor.
Code in manager can now just call queue_metadata_update with a
(freeable) buf holding the update, and it will get passed to the
monitor and written out.
2008-06-12 10:13:23 +10:00
Neil Brown cba0191bad Parse the 'instance' part of external:/mdXX/INST in metadata handler.
This give more flexability.
2008-05-27 09:18:57 +10:00
Neil Brown 159c3a1a77 Remove st->text_version in favour of info->text_version
I want the metadata handler to have more control over the 'version',
particularly for arrays which are members of containers.
So discard st->text_version and instead use info->text_version
which getinfo_super can initialise.
2008-05-27 09:18:55 +10:00
Neil Brown ed9d66aade Change mark_clean to set_array_state.
DDF needs more fine grained understanding of the array state.
2008-05-27 09:18:54 +10:00
Neil Brown 4e5528c6f7 Implement mark_clean for ddf and remove mark_dirty and mark_sync
mark_dirty is just a special case of mark_clean - with sync_pos == 0.
mark_sync is not required.  We don't modify the metadata when sync
finishes.  Only when the array becomes non-writeable at which point we
use mark_clean to record how far the resync progressed.
2008-05-27 09:18:38 +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 c2a1e7dad7 imsm: update metadata for dirty -> clean or resync -> idle events
From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:47 +10:00
Dan Williams 3dbccbcf5f keep member disk fd(s) for updates
From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:46 +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
Neil Brown 845dea950c Add mdmon functions to super-intel. 2008-05-15 16:48:41 +10:00
Dan Williams 0fd5c350e5 set resync_start in Incremental_container
From: Dan Williams <dan.j.williams@intel.com>

Metadata handlers set mdinfo.resync_start depending on the state of the
array.  By default mdadm assumes the array is dirty and needs a full
resync.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:33 +10:00
Dan Williams 4f5bc4542c imsm: assemble raid devices
From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:27 +10:00
Dan Williams f352c54527 imsm: assemble container support
From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:24 +10:00
Dan Williams cdddbdbca0 imsm: initial Intel(R) Matrix Storage Manager support
From: Dan Williams <dan.j.williams@intel.com>

The following now work:
--examine
--examine --brief

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:22 +10:00