thirdparty/mdadm.git
12 years agoStop managed arrays more carefully.
Neil Brown [Fri, 18 Jul 2008 06:37:09 +0000 (16:37 +1000)] 
Stop managed arrays more carefully.

If an array is being managed by mdmon, then just
write "inactive" to stop it, and let mdmon do the
final "clear".  This makes sure mdmon has a chance
to read the final state and update the metadata properly.

After writing "inactive" with use "ping_monitor" to synchronise
with mdadm, then STOP the array just in case it is still running,
else we will get into an infinite loop in "mdadm -Ss".

Signed-off-by: Neil Brown <neilb@suse.de>
12 years agomdmon: ping will wait for manage_mon to catch up.
NeilBrown [Fri, 18 Jul 2008 06:37:06 +0000 (16:37 +1000)] 
mdmon: ping will wait for manage_mon to catch up.

When a 'ping' (empty message) is sent to mdmon, we wait for
'monitor' to do a full loop to make sure it has caught up
with anything that needs doing.
This allows synchronisation between mdadm and mdmon.

Maybe monitor should signal managemon rather than managemon polling...

Signed-off-by: Neil Brown <neilb@suse.de>
12 years agoMake sure resync_start is initialised properly and maintained properly
Neil Brown [Fri, 18 Jul 2008 06:37:04 +0000 (16:37 +1000)] 
Make sure resync_start is initialised properly and maintained properly

Signed-off-by: Neil Brown <neilb@suse.de>
12 years agoddf: endian fixes.
Neil Brown [Fri, 18 Jul 2008 06:37:03 +0000 (16:37 +1000)] 
ddf: endian fixes.

We forgot to convert endian for lba_offset at one point,
and use le32 instead of be32 right nearby!!

Signed-off-by: Neil Brown <neilb@suse.de>
12 years agomdmon: close possibility of re-marking the metadata dirty on shutdown
Dan Williams [Mon, 14 Jul 2008 21:59:39 +0000 (14:59 -0700)] 
mdmon: close possibility of re-marking the metadata dirty on shutdown

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agomdmon: notify metadata of recovery completion
Dan Williams [Mon, 14 Jul 2008 21:59:39 +0000 (14:59 -0700)] 
mdmon: notify metadata of recovery completion

Array may no longer be degraded.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agomdmon: initialize component_size in manage_new
Dan Williams [Mon, 14 Jul 2008 21:59:39 +0000 (14:59 -0700)] 
mdmon: initialize component_size in manage_new

When we go to activate a spare for an array we expect ->info.component_size
is valid.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agomdmon: close small window of invalid mon_tid
Dan Williams [Mon, 14 Jul 2008 21:59:39 +0000 (14:59 -0700)] 
mdmon: close small window of invalid mon_tid

There is a small chance that the manager tries to wake the monitor before
mon_tid is set.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agomdadm: add an environment variable to prevent auto-launching mdmon
Dan Williams [Mon, 14 Jul 2008 21:59:32 +0000 (14:59 -0700)] 
mdadm: add an environment variable to prevent auto-launching mdmon

Useful for attaching gdb to mdmon before any action is taken on the array.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agomanagemon: don't treat sysfs_add_disk as boolean function
Dan Williams [Mon, 14 Jul 2008 21:10:02 +0000 (14:10 -0700)] 
managemon: don't treat sysfs_add_disk as boolean function

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: process update
Dan Williams [Mon, 14 Jul 2008 21:10:02 +0000 (14:10 -0700)] 
imsm: process update

Handle 'activate_spare' events

12 years agoimsm: activate_spare
Dan Williams [Wed, 25 Jun 2008 05:21:21 +0000 (22:21 -0700)] 
imsm: activate_spare

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: metadata only supports a global 'data_offset'
Dan Williams [Mon, 14 Jul 2008 20:59:56 +0000 (13:59 -0700)] 
imsm: metadata only supports a global 'data_offset'

When creating a volume a drive must have free space starting at the same
location as all the other drives in the array.

12 years agoimsm: fix raid1 creation
Dan Williams [Wed, 25 Jun 2008 04:56:19 +0000 (21:56 -0700)] 
imsm: fix raid1 creation

Need to supply dummy values for the chunk size and number of data stripes

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: fail ->open_new if container_member is out of range
Dan Williams [Mon, 14 Jul 2008 20:57:33 +0000 (13:57 -0700)] 
imsm: fail ->open_new if container_member is out of range

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: kill obsolete call to fsync() in store_imsm_mpb
Dan Williams [Mon, 14 Jul 2008 20:56:42 +0000 (13:56 -0700)] 
imsm: kill obsolete call to fsync() in store_imsm_mpb

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: fix insufficient mpb buffer allocation
Dan Williams [Sat, 21 Jun 2008 07:19:53 +0000 (00:19 -0700)] 
imsm: fix insufficient mpb buffer allocation

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: catch posix_memalign allocation failures
Dan Williams [Mon, 14 Jul 2008 20:55:12 +0000 (13:55 -0700)] 
imsm: catch posix_memalign allocation failures

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: remove extra superswitches
Dan Williams [Tue, 24 Jun 2008 13:16:44 +0000 (06:16 -0700)] 
imsm: remove extra superswitches

Following the lead of 75ede16d.  This incidentally fixes creation of a second
array by gating call to getinfo_super_imsm_volume with a valid ->current_vol.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: fix store_imsm_mpb() alignment for O_DIRECT
Dan Williams [Mon, 14 Jul 2008 20:55:02 +0000 (13:55 -0700)] 
imsm: fix store_imsm_mpb() alignment for O_DIRECT

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoPrint used message in place of "default metadata" message.
Neil Brown [Sat, 12 Jul 2008 10:28:38 +0000 (20:28 +1000)] 
Print used message in place of "default metadata" message.

When creating an array in a container, print e.g.
   Creating array inside ddf container /dev/whatever
rather than
   Defaulting to version /md127/1 metadata

12 years agoIntroduce devname2devnum
Neil Brown [Sat, 12 Jul 2008 10:28:38 +0000 (20:28 +1000)] 
Introduce devname2devnum

and use it instead of opencoding.

12 years agoFix fd comparison in Incremental
Neil Brown [Sat, 12 Jul 2008 10:28:38 +0000 (20:28 +1000)] 
Fix fd comparison in Incremental

fd==0 is theoretically possible...

12 years agoPass 'verbose' flag to validate_geometry
Neil Brown [Sat, 12 Jul 2008 10:28:38 +0000 (20:28 +1000)] 
Pass 'verbose' flag to validate_geometry

That way it can be silent when we are just trying to figure out
which metadata to use, and noisy when detecting a real problem.

12 years agoCorrect unit conversion for component_size and dev/size in sysfs.
Neil Brown [Sat, 12 Jul 2008 10:28:38 +0000 (20:28 +1000)] 
Correct unit conversion for component_size and dev/size in sysfs.

These are both Kilobytes, so do the conversion to sectors properly.

12 years agoUse O_DIRECT for all IO to devices.
Neil Brown [Sat, 12 Jul 2008 10:28:33 +0000 (20:28 +1000)] 
Use O_DIRECT for all IO to devices.

Using buffered IO risks non-atomic updates to parts of the
device that we don't actually want to write to.  This isn't in
general safe.
So switch to O_DIRECT for all that IO and make sure we have
properly aligned buffers.

12 years agoStop all arrays before running each test in regression test driver.
Neil Brown [Sat, 12 Jul 2008 10:27:42 +0000 (20:27 +1000)] 
Stop all arrays before running each test in regression test driver.

Sometimes I forget to stop arrays at the end of scripts, and
that shows errors in the next script, which is confusing.

12 years agoddf: Set container_member from subarray in getinfo_super.
Neil Brown [Sat, 12 Jul 2008 10:27:42 +0000 (20:27 +1000)] 
ddf: Set container_member from subarray in getinfo_super.

Also go direct from subarray to text_version.

12 years agoReduce the number of metadata updates done by ddf.
Neil Brown [Sat, 12 Jul 2008 10:27:42 +0000 (20:27 +1000)] 
Reduce the number of metadata updates done by ddf.

1/ track if there are any actual updates pending, and only
   write metadata when we have changed something.

2/ when writing null virtual-configs, write full blocks,
   not just the first 4 bytes.  This will allow O_DIRECT
   writes in a subsequent patch.

12 years agoImprove shutdown for container-based arrays.
Neil Brown [Sat, 12 Jul 2008 10:27:42 +0000 (20:27 +1000)] 
Improve shutdown for container-based arrays.

1/ close a race where multiple arrays disappear at once
   and monitor isn't woken up to find out that the last one
   has gone.
2/ "mdadm -Ss" needs to pause briefly for mdmon to exit.

12 years agoKeep container device open in monitor
Neil Brown [Sat, 12 Jul 2008 10:27:42 +0000 (20:27 +1000)] 
Keep container device open in monitor

... so that it cannot be stopped while there are active arrays.
I don't know where that second 'close' came from ....

12 years agoMake sure we remove pid file in monitor before manager exits.
Neil Brown [Sat, 12 Jul 2008 10:27:42 +0000 (20:27 +1000)] 
Make sure we remove pid file in monitor before manager exits.

12 years agoRemove some noisy printfs.
Neil Brown [Sat, 12 Jul 2008 10:27:41 +0000 (20:27 +1000)] 
Remove some noisy printfs.

12 years agoCreate arrays via metadata-update
Neil Brown [Sat, 12 Jul 2008 10:27:40 +0000 (20:27 +1000)] 
Create arrays via metadata-update

Support creating arrays inside an active ddf container by
sending a metadata update over a pipe to mdmon.

12 years agoRevise message passing code.
Neil Brown [Sat, 12 Jul 2008 10:27:40 +0000 (20:27 +1000)] 
Revise message passing code.

More here

12 years agoRemove mgr_pipe for communicating from manage to monitor.
Neil Brown [Sat, 12 Jul 2008 10:27:40 +0000 (20:27 +1000)] 
Remove mgr_pipe for communicating from manage to monitor.

Data is being passed in shared memory, so the pipe is only being
use as a wakeup.  This can more easily be done with a thread-signal.

12 years agoRemove mon_pipe for communicating from monitor to manager
Neil Brown [Sat, 12 Jul 2008 10:27:40 +0000 (20:27 +1000)] 
Remove mon_pipe for communicating from monitor to manager

The returned value was never used, and we don't really want
this return path anyway as writing to a pipe could conceivably
block, and the monitor must not block.

12 years agoHandle device removal from container
Neil Brown [Sat, 12 Jul 2008 10:27:40 +0000 (20:27 +1000)] 
Handle device removal from container

This really should be done in mdadm, not mdmon.
We ensure the device won't be suddenly commited as a hot-spare
using O_EXCL, then check the 'holders' sysfs directory
to make sure it is only in use once.

12 years agoFix kernel patch
Neil Brown [Sat, 12 Jul 2008 10:27:39 +0000 (20:27 +1000)] 
Fix kernel patch

12 years agoMake super super0.c function static.
Neil Brown [Sat, 12 Jul 2008 10:27:39 +0000 (20:27 +1000)] 
Make super super0.c function static.

So only 'super0' is externally visible.

12 years agoRemove the multiple super_switchs for ddf.
Neil Brown [Sat, 12 Jul 2008 10:27:39 +0000 (20:27 +1000)] 
Remove the multiple super_switchs for ddf.

It is simpler if there is just one, and the methods
make decisions as appropriate.

12 years agoRemove silly convention that major='-1' means 'zero superblock'.
Neil Brown [Sat, 12 Jul 2008 10:27:39 +0000 (20:27 +1000)] 
Remove silly convention that major='-1' means 'zero superblock'.

Use 'info pointer is NULL' instead.

12 years agoRemove getinfo_super_n and do some other cleaning up.
Neil Brown [Sat, 12 Jul 2008 10:27:39 +0000 (20:27 +1000)] 
Remove getinfo_super_n and do some other cleaning up.

Getting close to a sensible description of what some of the
superswitch methods are supposed to do!

12 years agoExternal metadata shouldn't set array.*_version
Neil Brown [Sat, 12 Jul 2008 10:27:39 +0000 (20:27 +1000)] 
External metadata shouldn't set array.*_version

It doesn't mean anything and is never used.

12 years agoAdd subarray field to supertype.
Neil Brown [Sat, 12 Jul 2008 10:27:38 +0000 (20:27 +1000)] 
Add subarray field to supertype.

When loading the metadata for a subarray (super_by_fd), we set
->subarray to be the name read from md/metadata_version so that
getinfo_super can return info about the correct array.

With this we can differentiate between a container and
an array within the container by looking at ->subarray[0].

12 years agoAdd some comments to explain some of the bits of superswitch.
Neil Brown [Sat, 12 Jul 2008 10:27:38 +0000 (20:27 +1000)] 
Add some comments to explain some of the bits of superswitch.

12 years agoHide subordinate superswitch structures.
Neil Brown [Sat, 12 Jul 2008 10:27:38 +0000 (20:27 +1000)] 
Hide subordinate superswitch structures.

Only one superswitch should be externally visible for each
general type.  Others which handle different flavours
(e.g. container/data-array) should be internal only.

12 years agoRemove 'major' from superswitch.
Neil Brown [Sat, 12 Jul 2008 10:27:37 +0000 (20:27 +1000)] 
Remove 'major' from superswitch.

It isn't generally meaningful.

12 years agoUse text_version in map_file rather than major.minor.
Neil Brown [Sat, 12 Jul 2008 10:27:37 +0000 (20:27 +1000)] 
Use text_version in map_file rather than major.minor.

12 years agoAssorted cleanups to DDF
Neil Brown [Sat, 12 Jul 2008 10:27:37 +0000 (20:27 +1000)] 
Assorted cleanups to DDF

12 years agoFix write_init_super usage when hot-adding a spare
Neil Brown [Sat, 12 Jul 2008 10:27:36 +0000 (20:27 +1000)] 
Fix write_init_super usage when hot-adding a spare

Using write_init_super to add a spare to an active array is quite
different to how it is used when creating an array.

It mostly works, but if we are adding two devices to an array,
then when we add the second, there are still traces of the first
which confuse write_init_super.

So get write_init_super to ignore those traces.  Longer term, we
probably want to do this differently as for DDF, hot-adding to
an active array will have to be quite different - it will want to
write to all metadata, possibly via mdmon.

12 years agoAlways zero a struct ddf_super on allocation.
Neil Brown [Sat, 12 Jul 2008 10:27:36 +0000 (20:27 +1000)] 
Always zero a struct ddf_super on allocation.

12 years agoAlways initialise a struct super_type to zero
Neil Brown [Sat, 12 Jul 2008 10:27:36 +0000 (20:27 +1000)] 
Always initialise a struct super_type to zero

12 years agoFix freeing of updates that have been handled by monitor.
Neil Brown [Sat, 12 Jul 2008 10:27:33 +0000 (20:27 +1000)] 
Fix freeing of updates that have been handled by monitor.

Yes, we do want to free the buf, and the space too if it is still
there.

12 years agoAlways assume_clean for raid0, linear, multipath, faulty
Neil Brown [Thu, 10 Jul 2008 22:50:06 +0000 (08:50 +1000)] 
Always assume_clean for raid0, linear, multipath, faulty

For arrays that don't have redundancy (raid0, linear etc), the
clean/dirty distinction doesn't mean anything.  So always
'assume clean' for these arrays.

12 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/mdadm...
Neil Brown [Fri, 20 Jun 2008 05:13:27 +0000 (15:13 +1000)] 
Merge branch 'release' of git://git./linux/kernel/git/djbw/mdadm into devel-3.0

12 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/mdadm...
Neil Brown [Thu, 19 Jun 2008 06:41:25 +0000 (16:41 +1000)] 
Merge branch 'release' of git://git./linux/kernel/git/djbw/mdadm into devel-3.0

12 years agoMerge branch 'master' into devel-3.0
Neil Brown [Thu, 19 Jun 2008 06:38:37 +0000 (16:38 +1000)] 
Merge branch 'master' into devel-3.0

Conflicts:

Makefile

12 years agoFix bug in forced assemble.
Chris Webb [Thu, 19 Jun 2008 06:30:39 +0000 (16:30 +1000)] 
Fix bug in forced assemble.

From: Chris Webb <chris@arachsys.com>

We are loading into the already-loaded 'st' instead of the
newly create 'tst', which is clearly wrong.

12 years agoFix an error when assembling arrays that are in the middle of a reshape.
Neil Brown [Thu, 19 Jun 2008 06:30:36 +0000 (16:30 +1000)] 
Fix an error when assembling arrays that are in the middle of a reshape.

It is important that dup_super always returns an 'st' with the same
->ss and ->minor_version as the st that was passed.
This wasn't happening for 0.91 metadata (i.e. in the middle of a reshape).

12 years agomdmon: add debug print statements for profiling mdmon
Dan Williams [Mon, 16 Jun 2008 22:50:07 +0000 (15:50 -0700)] 
mdmon: add debug print statements for profiling mdmon

for development only as console output can block leading to monitor deadlocks
in low mem situations

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: set map state depending on sync state
Dan Williams [Mon, 16 Jun 2008 22:36:41 +0000 (15:36 -0700)] 
imsm: set map state depending on sync state

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: reenable mdmon
Dan Williams [Mon, 16 Jun 2008 22:36:41 +0000 (15:36 -0700)] 
imsm: reenable mdmon

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: write anchor last
Dan Williams [Mon, 16 Jun 2008 22:36:41 +0000 (15:36 -0700)] 
imsm: write anchor last

Ensure that newly written anchors reflect a consistent metadata block.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: implement store_zero_imsm and init_zero_imsm
Dan Williams [Mon, 16 Jun 2008 22:36:40 +0000 (15:36 -0700)] 
imsm: implement store_zero_imsm and init_zero_imsm

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: ->getinfo_super set raid_disk to disk.number
Dan Williams [Mon, 16 Jun 2008 22:36:40 +0000 (15:36 -0700)] 
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>
12 years agoimsm: add 'Create' support
Dan Williams [Mon, 16 Jun 2008 22:36:38 +0000 (15:36 -0700)] 
imsm: add 'Create' support

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: 'volume' is the proper name for imsm container members
Dan Williams [Sat, 14 Jun 2008 00:42:09 +0000 (17:42 -0700)] 
imsm: 'volume' is the proper name for imsm container members

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoimsm: ->container_dev needs to be set in load_super_imsm_all
Dan Williams [Sat, 14 Jun 2008 00:42:09 +0000 (17:42 -0700)] 
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>
12 years agoimsm: add 'mpb_size' to --examine output
Dan Williams [Sat, 14 Jun 2008 00:42:09 +0000 (17:42 -0700)] 
imsm: add 'mpb_size' to --examine output

Break out sector_count() for use elsewhere.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agosysfs: helper routine to retrieve the scsi id
Dan Williams [Sat, 14 Jun 2008 00:27:30 +0000 (17:27 -0700)] 
sysfs: helper routine to retrieve the scsi id

imsm records this information in its metadata

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agosysfs: provide a helper function for locating scsi_generic interfaces
Dan Williams [Sat, 14 Jun 2008 00:27:30 +0000 (17:27 -0700)] 
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>
12 years agoddf: fix up validate_geometry to ignore other containers
Dan Williams [Sat, 14 Jun 2008 00:27:30 +0000 (17:27 -0700)] 
ddf: fix up validate_geometry to ignore other containers

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoddf: fix 'ddf' pointer corruption
Dan Williams [Sat, 14 Jun 2008 00:27:30 +0000 (17:27 -0700)] 
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>
12 years agoddf: convert size paramter to sectors when calling avail_size_ddf
Dan Williams [Sat, 14 Jun 2008 00:27:30 +0000 (17:27 -0700)] 
ddf: convert size paramter to sectors when calling avail_size_ddf

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
12 years agoA kernel patch needed to add a spare to an active external-metadata array devel
Neil Brown [Thu, 12 Jun 2008 02:06:14 +0000 (12:06 +1000)] 
A kernel patch needed to add a spare to an active external-metadata array

12 years agoAdd DDF code for activate_spare
Neil Brown [Thu, 12 Jun 2008 00:13:32 +0000 (10:13 +1000)] 
Add DDF code for activate_spare

Plus various bug fixes etc.

12 years agoSupport adding a spare to a degraded array.
Neil Brown [Thu, 12 Jun 2008 00:13:29 +0000 (10:13 +1000)] 
Support adding a spare to a degraded array.

When signalled by the monitor, the manager will find spares and
add them to the array and initiate a recovery.

12 years agoSome fixes to make failures in ddf get handled properly.
Neil Brown [Thu, 12 Jun 2008 00:13:28 +0000 (10:13 +1000)] 
Some fixes to make failures in ddf get handled properly.

12 years agoCorrectly set resync_start when creating an array.
Neil Brown [Thu, 12 Jun 2008 00:13:26 +0000 (10:13 +1000)] 
Correctly set resync_start when creating an array.

12 years agoDDF: Update array state and disk state properly when adding to a BVD
Neil Brown [Thu, 12 Jun 2008 00:13:25 +0000 (10:13 +1000)] 
DDF: Update array state and disk state properly when adding to a BVD

12 years agosuper method for updating ddf metadata.
Neil Brown [Thu, 12 Jun 2008 00:13:24 +0000 (10:13 +1000)] 
super method for updating ddf metadata.

12 years agoAllow passing metadata update to the monitor.
Neil Brown [Thu, 12 Jun 2008 00:13:23 +0000 (10:13 +1000)] 
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.

12 years agoStore and recover spare_assign info in DDF.
Neil Brown [Thu, 12 Jun 2008 00:13:22 +0000 (10:13 +1000)] 
Store and recover spare_assign info in DDF.

12 years agoAdd mppe and conf_rec_len to struct super_ddf
Neil Brown [Thu, 12 Jun 2008 00:13:20 +0000 (10:13 +1000)] 
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.

12 years agoDon't ignore errors in sysfs_add_disk.
Neil Brown [Thu, 12 Jun 2008 00:13:19 +0000 (10:13 +1000)] 
Don't ignore errors in sysfs_add_disk.

i.e. if the add fails, don't add the device to the internal data
structures.

12 years agoRelease 2.6.7 mdadm-2.6.7
Neil Brown [Fri, 6 Jun 2008 06:07:11 +0000 (16:07 +1000)] 
Release 2.6.7

12 years agoAvoid NULL reference calling free_super and elsewhere.
Neil Brown [Tue, 27 May 2008 07:23:16 +0000 (17:23 +1000)] 
Avoid NULL reference calling free_super and elsewhere.

Since we made free_super a superswitch call, we need to be careful
that st is non NULL before calling st->ss->free_super(st).
Also when updating byteorder there is a chance of a similar NULL
deref.

12 years agoRemove stray semicolon
Neil Brown [Tue, 27 May 2008 07:23:09 +0000 (17:23 +1000)] 
Remove stray semicolon

Causes compile error with gcc-2.95

12 years agoFix some stuff.
Neil Brown [Mon, 26 May 2008 23:18:58 +0000 (09:18 +1000)] 
Fix some stuff.

12 years agoParse the 'instance' part of external:/mdXX/INST in metadata handler.
Neil Brown [Mon, 26 May 2008 23:18:57 +0000 (09:18 +1000)] 
Parse the 'instance' part of external:/mdXX/INST in metadata handler.

This give more flexability.

12 years agoDiscard st->container_member
Neil Brown [Mon, 26 May 2008 23:18:56 +0000 (09:18 +1000)] 
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.

12 years agoRemove st->text_version in favour of info->text_version
Neil Brown [Mon, 26 May 2008 23:18:55 +0000 (09:18 +1000)] 
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.

12 years agoChange mark_clean to set_array_state.
Neil Brown [Mon, 26 May 2008 23:18:54 +0000 (09:18 +1000)] 
Change mark_clean to set_array_state.

DDF needs more fine grained understanding of the array state.

12 years agoDiscard get_sync_pos. We should be using get_resync_start.
Neil Brown [Mon, 26 May 2008 23:18:53 +0000 (09:18 +1000)] 
Discard get_sync_pos.  We should be using get_resync_start.

"sync_complete" just tracks the current resync/recover/check/whatever pass.
"resync_start" tracks which parts of the array are known to be in-sync
(modulo active writes).  So it is what we need to use to update the metadata.
Also we cannot call it when the array has stopped, as the value is no longer
available then.  We must call it when the resync completes.
Possibly also call it preiodically if the array is quiescent.

12 years agoStart mdmon during incremental assembly of container
Neil Brown [Mon, 26 May 2008 23:18:52 +0000 (09:18 +1000)] 
Start mdmon during incremental assembly of container

12 years agoallow --incremental to reuse devices that already exist
Neil Brown [Mon, 26 May 2008 23:18:43 +0000 (09:18 +1000)] 
allow --incremental to reuse devices that already exist

.. and other fixes.

12 years agoauto-start mdmon on --create
Neil Brown [Mon, 26 May 2008 23:18:42 +0000 (09:18 +1000)] 
auto-start mdmon on --create

FIXME uses sill hardcoded path.

Need --assemble too.

12 years agoExit when there are no more arrays to manage.
Neil Brown [Mon, 26 May 2008 23:18:41 +0000 (09:18 +1000)] 
Exit when there are no more arrays to manage.

12 years agoRemove supertype->devfd
Neil Brown [Mon, 26 May 2008 23:18:40 +0000 (09:18 +1000)] 
Remove supertype->devfd

It is never used.