Commit Graph

471 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 b109d92863 start fleshing out socket code, ping monitor to see if it is alive
From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:52 +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 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 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
Neil Brown 845dea950c Add mdmon functions to super-intel. 2008-05-15 16:48:41 +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
Dan Williams f7dd881f90 handle Manage_subdevs() for 'external' arrays
From: Dan Williams <dan.j.williams@intel.com>

1/ Block attempts to add/remove devices from container members
2/ Forward add/remove requests to containers

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:35 +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 3cfe624740 imsm: create support
From: Dan Williams <dan.j.williams@intel.com>

This should probably be made into a generic 'external' capability rather
than hardcoding 'ddf' and 'imsm'.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-15 16:48:32 +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 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
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
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 2503d23b5a More ddf stuff 2008-05-15 16:48:17 +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
Neil Brown d03373f1de Some support for external metadata.
Allow specifying metadata type when creating arrays etc.
2008-05-15 16:48:13 +10:00
Neil Brown 111d01fcc7 Change write_init_super to be called only once.
The current model for creating arrays involves writing
a superblock to each device in the array.
With containers (as with DDF), that model doesn't work.
Every device in the container may need to be updated
for an array made from just some the devices in a container.

So instead of calling write_init_super for each device,
we call it once for the array and have it iterate over
all the devices in the array.

To help with this, ->add_to_super now passes in an 'fd' and name for
the device.  These get saved for use by write_init_super.  So
add_to_super takes ownership of the fd, and write_init_super will
close it.
This information is stored in the new 'info' field of supertype.

As part of this, write_init_super now removes any old traces of raid
metadata rather than doing this in common code.
2008-05-15 16:48:12 +10:00
Neil Brown 11fcec12ef Add crc32 files.
For ddf.
2008-05-15 16:48:10 +10:00
Neil Brown 974e620d66 Add cpu_to_be convertions functions.
DDF will uses these.
2008-05-15 16:48:09 +10:00
Neil Brown b6e63da496 Reduce openning of dev in create.
Now that validate_geometry opens and checks the device,
we don't need to do it as much in top level Create.
We only need it to check for old array or filesystem info.
So only open the device at that place.
2008-05-15 16:48:08 +10:00
Neil Brown 17f25ca6fb Add 'container' level and ->validate_geometry method.
These will be used for ddf.
2008-05-15 16:47:41 +10:00
Neil Brown 2270232245 Release 2.6.5 2008-05-15 15:50:59 +10:00
Neil Brown e509e779cd Get Changelog uptodate 2008-05-15 15:50:57 +10:00
Neil Brown ea24acd073 Compiple fixes for mdassemble and diet-libc 2008-05-15 15:50:56 +10:00
Neil Brown 54097ce72b Don't try the auto-detect test when md_mod is a module
....as this cannot work.
2008-05-15 15:50:50 +10:00
Neil Brown ff1f6545db Fix support for --update=swapsuper
The user of dup_super broke it.
2008-05-15 15:50:48 +10:00
Neil Brown 294d6f450f Recent change broken handling of metadata-less arrays.
In particular, failing a device would give a silly
error message.
2008-05-15 15:50:47 +10:00
Neil Brown 3b0896f899 Fix possible NULL dereference in super_by_fd 2008-05-15 15:50:45 +10:00
Neil Brown ddd1a49251 Avoid possible null dereference in Assemble.
If the first device we look at has no superblock,
there is no 'st' to free, so don't free it.
2008-05-15 15:50:42 +10:00
Hans Lambermont 6ac8aac226 Set LOG_PID for syslog
From: Hans Lambermont <hans.lambermont@newtec.eu>
2008-05-12 12:21:56 +10:00
Kay Sievers 0d726f17e1 add --export option to --examine
From: Kay Sievers <kay.sievers@vrfy.org>

Cc: David Zeuthen <david@fubar.dk>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
2008-05-06 10:02:38 +10:00
Neil Brown 9a02c62af9 Make device-special files for partitions when using --incremental 2008-05-05 21:55:39 +10:00
Dan Williams 95b79df03e let '-a' be specified for Incremental mode
From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-05 21:55:37 +10:00
Neil Brown 63152c1b33 Unify code into find_free_devnum.
Two places have code to find a free md device number.  Make this
a subroutine.
2008-05-05 21:55:36 +10:00
Dan Williams 5e747af24a fix load_super/free_super mismatch in util.c
From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-05-05 21:55:35 +10:00
Bill Nottingham 767bd45298 Simplistig locking for --incremental.
From: Bill Nottingham <notting@redhat.com>

mdadm --incremental doesn't really do any locking. If you get multiple
events in parallel for the same device (that has not yet started), they
will all go down the path to create the array. One will succeed, the
rest will have SET_ARRAY_INFO die with -EBUSY (md: array mdX already has disks!)
and will exit without adding the disk.

Original bug report is: https://bugzilla.redhat.com/show_bug.cgi?id=433932

This is solved by adding very very rudimentary locking. Incremental() now
opens the device with O_EXCL to ensure only one invocation is frobbing the
array at once. A simple loop just tries to open 5 times a second for 5
seconds. If the array stays locked that long, you probably have bigger
issues.
2008-05-05 19:44:04 +10:00
Bill Nottingham 62552fdfcc Create /dev/md if needed and it doesn't exist.
From: Bill Nottingham <notting@redhat.com>
2008-05-05 19:44:01 +10:00
Neil Brown 02b76eeace Fix RAID acronym in man page.
The 'D' in 'RAID' stands for 'DISKS' even it md supports other 'devices'.
2008-05-05 19:43:58 +10:00
Neil Brown 25b05c515e Add a .gitignore file. 2008-04-29 17:14:01 +10:00
Neil Brown e43d0cda22 Use .\" instead of '''
Debian bug 477273
2008-04-29 17:13:59 +10:00
Neil Brown c2c9bb6fe0 diff -ru mdadm-2.6.4-orig/Query.c mdadm-2.6.4/Query.c 2008-04-29 17:13:55 +10:00