Neil Brown
a35c070bcd
Remove some noisy printfs.
2008-07-12 20:27:41 +10:00
Neil Brown
edd8d13c02
Create arrays via metadata-update
...
Support creating arrays inside an active ddf container by
sending a metadata update over a pipe to mdmon.
2008-07-12 20:27:40 +10:00
Neil Brown
bfa44e2e7a
Revise message passing code.
...
More here
2008-07-12 20:27:40 +10:00
Neil Brown
4d43913ce0
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.
2008-07-12 20:27:40 +10:00
Neil Brown
2f64e61a50
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.
2008-07-12 20:27:40 +10:00
Neil Brown
f94d52f43e
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.
2008-07-12 20:27:40 +10:00
Neil Brown
d4da74fc9c
Fix kernel patch
2008-07-12 20:27:39 +10:00
Neil Brown
ec9688ca70
Make super super0.c function static.
...
So only 'super0' is externally visible.
2008-07-12 20:27:39 +10:00
Neil Brown
78e449282e
Remove the multiple super_switchs for ddf.
...
It is simpler if there is just one, and the methods
make decisions as appropriate.
2008-07-12 20:27:39 +10:00
Neil Brown
ba7eb04f71
Remove silly convention that major='-1' means 'zero superblock'.
...
Use 'info pointer is NULL' instead.
2008-07-12 20:27:39 +10:00
Neil Brown
d2ca644994
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!
2008-07-12 20:27:39 +10:00
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