Commit Graph

545 Commits

Author SHA1 Message Date
Neil Brown 0d481d3723 External metadata shouldn't set array.*_version
It doesn't mean anything and is never used.
2008-07-12 20:27:39 +10:00
Neil Brown f7e7067b47 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].
2008-07-12 20:27:38 +10:00
Neil Brown 6adfd3affd Add some comments to explain some of the bits of superswitch. 2008-07-12 20:27:38 +10:00
Neil Brown 0063ecba3d 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.
2008-07-12 20:27:38 +10:00
Neil Brown b8ac196795 Remove 'major' from superswitch.
It isn't generally meaningful.
2008-07-12 20:27:37 +10:00
Neil Brown 1522c538b1 Use text_version in map_file rather than major.minor. 2008-07-12 20:27:37 +10:00
Neil Brown 59e3626815 Assorted cleanups to DDF 2008-07-12 20:27:37 +10:00
Neil Brown a0c8a17f66 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.
2008-07-12 20:27:36 +10:00
Neil Brown 6264b43733 Always zero a struct ddf_super on allocation. 2008-07-12 20:27:36 +10:00
Neil Brown ef60947720 Always initialise a struct super_type to zero 2008-07-12 20:27:36 +10:00
Neil Brown 904c1ef77b 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.
2008-07-12 20:27:33 +10:00
Neil Brown d024b0a7eb 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.
2008-07-11 08:50:06 +10:00
Neil Brown 9686a7b5c5 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/mdadm into devel-3.0 2008-06-20 15:13:27 +10:00
Neil Brown b57f7529f8 Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/mdadm into devel-3.0 2008-06-19 16:41:25 +10:00
Neil Brown 370ac380fd Merge branch 'master' into devel-3.0
Conflicts:

	Makefile
2008-06-19 16:38:37 +10:00
Chris Webb 60b435db5a 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.
2008-06-19 16:30:39 +10:00
Neil Brown 56f8add211 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).
2008-06-19 16:30:36 +10:00
Dan Williams 4e6e574a3e 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>
2008-06-16 15:50:07 -07:00
Dan Williams a862209dc3 imsm: set map state depending on sync state
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-16 15:36:41 -07:00
Dan Williams 5b65005fc8 imsm: reenable mdmon
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-16 15:36:41 -07:00
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 f1665f7200 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>
2008-06-13 17:27:30 -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
Dan Williams c42ec1ed43 ddf: fix up validate_geometry to ignore other containers
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
2008-06-13 17:27:30 -07:00
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 94f8ae072f A kernel patch needed to add a spare to an active external-metadata array 2008-06-12 12:06:14 +10: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 6c3fb95c44 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.
2008-06-12 10:13:29 +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 3cb07116bb Don't ignore errors in sysfs_add_disk.
i.e. if the add fails, don't add the device to the internal data
structures.
2008-06-12 10:13:19 +10:00
Neil Brown 866d136a2f Release 2.6.7 2008-06-06 16:07:11 +10:00
Neil Brown 3d2b16e77c 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.
2008-05-27 17:23:16 +10:00
Neil Brown fe2979bd16 Remove stray semicolon
Causes compile error with gcc-2.95
2008-05-27 17:23:09 +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