Commit Graph

332 Commits

Author SHA1 Message Date
Dan Williams 1ba6bff902 ddf: fix 'ddf' pointer corruption
hostname[17] = 0 overwrites the last byte of the ddf pointer

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-13 17:27:30 -07:00
Dan Williams 56aca704a5 ddf: convert size paramter to sectors when calling avail_size_ddf
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-13 17:27:30 -07:00
Neil Brown 7e1432fb14 Add DDF code for activate_spare
Plus various bug fixes etc.
2008-06-12 10:13:32 +10:00
Neil Brown 57632f4afb Some fixes to make failures in ddf get handled properly. 2008-06-12 10:13:28 +10:00
Neil Brown 80d26cb2fd Correctly set resync_start when creating an array. 2008-06-12 10:13:26 +10:00
Neil Brown 5575e7d962 DDF: Update array state and disk state properly when adding to a BVD 2008-06-12 10:13:25 +10:00
Neil Brown 88c164f42b super method for updating ddf metadata. 2008-06-12 10:13:24 +10: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 b228067720 Store and recover spare_assign info in DDF. 2008-06-12 10:13:22 +10:00
Neil Brown 8c3b8c2c11 Add mppe and conf_rec_len to struct super_ddf
Rather than having to pull them from inside structures and
be_to_cpu them all the time.
2008-06-12 10:13:20 +10:00
Neil Brown 60f18132be Fix some stuff. 2008-05-27 09:18:58 +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 dd15dc4a4d Discard st->container_member
'container_member' isn't really a well defined concept.
Each metadata might enumerate members differently, so just
let each format /mdX/YYYY as appropriate.
2008-05-27 09:18:56 +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 75aa18b53c Start mdmon during incremental assembly of container 2008-05-27 09:18:52 +10:00
Neil Brown 25dbe93ab4 allow --incremental to reuse devices that already exist
.. and other fixes.
2008-05-27 09:18:43 +10:00
Neil Brown 7a7cc50430 Set status of devices in ddf.
Might work a little bit....
2008-05-27 09:18:38 +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
Neil Brown a2349791da Fix some initialisations... 2008-05-15 16:48:57 +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 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 549e9569c6 Merge mdmon 2008-05-15 16:48:37 +10:00
Dan Williams 5f2aace8eb Set 'metadata_version' for container_member in Incremental_container
From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:25 +10:00
Neil Brown 2f6079dc96 Create a container member
From: Neil Brown <neilb@suse.de>
2008-05-15 16:48:21 +10:00
Neil Brown 598f0d58ac Can now mostly assemble DDF arrays 2008-05-15 16:48:19 +10:00
Neil Brown a19c88b83d Start on --assemble support for DDF 2008-05-15 16:48:18 +10:00
Neil Brown 5f8097beb9 more ddf stuff
Create a BVD in a DDF

Do not actually assemble it yet...
2008-05-15 16:48:15 +10:00
Dan Williams a322f70c41 Initial DDF support code.
Create a ddf array by naming the device /dev/ddf* or
specifying metadata 'ddf'.

If ddf is specified with no level, assume a container (indeed,
anything else would be wrong).

**Need to use text_Version to set external metadata...

More ddf support

Load a ddf container.  Now
   --examine /dev/ddf
works.
super-ddf: fix compile warning

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

super-ddf.c:723: format %lu expects type long unsigned int, but argument 3 has type unsigned int

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:14 +10:00
Iustin Pop 3dacb89029 Explain the read-balancing algorithm for RAID1 better in md.4
From: Iustin Pop <iusty@k1024.org>

There are many questions on the mailing list about the RAID1 read
performance profile. This patch adds a new paragraph to the RAID1
section in md.4 that details what kind of speed-up one should expect
from RAID1.

Signed-off-by: Iustin Pop <iusty@k1024.org>
2007-09-11 16:20:19 +02:00
Neil Brown 005debfc11 Fix problem with add a device to a 1.x array created with older mdadm.
When adding new disk to an array, don't reserve so much bitmap
space that the disk cannot store the required data. (Needed when
1.x array was created with older mdadm).
2007-08-20 14:14:25 +10:00