summaryrefslogtreecommitdiffstats
path: root/super-ddf.c
Commit message (Collapse)AuthorAgeFilesLines
* allow add_to_super to return errorsDan Williams2008-11-271-3/+5
| | | | | | Prepare add_to_super to validate disks against the platform capabilities Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ddf: store homehost information to allow smooth assembly.NeilBrown2008-11-041-0/+2
| | | | | | | When we create our own ddf array, store the homehost in the vendor information so it can be so to ensure 'LOCAL' name choices. Signed-off-by: NeilBrown <neilb@suse.de>
* DDF: report member arrays in examine_brief.NeilBrown2008-11-041-10/+26
| | | | | | Thus an auto-generated config file will list all the arrays. Signed-off-by: NeilBrown <neilb@suse.de>
* DDF: fix irregularities with retrieval of 'name' from metadata.NeilBrown2008-11-041-3/+12
| | | | | | It is only 16 bytes, not 32. And is space padded, not nul terminated. Signed-off-by: NeilBrown <neilb@suse.de>
* Don't give array name in --examine --brief output if it is doubtful.NeilBrown2008-11-041-1/+1
| | | | | Now that mdadm.conf doesn't need an array name, we don't need to give one if the array cannot reliably provide one.
* ddf: get endian-ness of CRC correct.NeilBrown2008-10-271-1/+4
| | | | | | | All numeric fields in a DDF header big-endian, including the CRC, so better fix that. Signed-off-by: NeilBrown <neilb@suse.de>
* non-trivial warn_unused_result fix, prepare_updateDan Williams2008-10-151-2/+5
| | | | | | | If an allocation fails in ->prepare_update we need to catch it in ->process_update. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* non-trivial warn_unused_result fixes, activate_spareDan Williams2008-10-151-1/+16
| | | | | | | Both super-ddf and super-intel ignore memory allocation failures during ->activate_spare. Fix these up by cancelling the activation. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* non-trivial warn_unused_result fixes, write_init_super_ddfDan Williams2008-10-151-14/+34
| | | | | | When a write fails just move on to the next disk. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* trivial warn_unused_result squashingDan Williams2008-10-151-21/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made the mistake of recompiling the F9 mdadm rpm which has a patch to remove -Werror and add "-Wp,-D_FORTIFY_SOURCE -O2" which turns on lots of errors: config.c:568: warning: ignoring return value of asprintf Assemble.c:411: warning: ignoring return value of asprintf Assemble.c:413: warning: ignoring return value of asprintf super0.c:549: warning: ignoring return value of posix_memalign super0.c:742: warning: ignoring return value of posix_memalign super0.c:812: warning: ignoring return value of posix_memalign super1.c:692: warning: ignoring return value of posix_memalign super1.c:1039: warning: ignoring return value of posix_memalign super1.c:1155: warning: ignoring return value of posix_memalign super-ddf.c:508: warning: ignoring return value of posix_memalign super-ddf.c:645: warning: ignoring return value of posix_memalign super-ddf.c:696: warning: ignoring return value of posix_memalign super-ddf.c:715: warning: ignoring return value of posix_memalign super-ddf.c:1476: warning: ignoring return value of posix_memalign super-ddf.c:1603: warning: ignoring return value of posix_memalign super-ddf.c:1614: warning: ignoring return value of posix_memalign super-ddf.c:1842: warning: ignoring return value of posix_memalign super-ddf.c:2013: warning: ignoring return value of posix_memalign super-ddf.c:2140: warning: ignoring return value of write super-ddf.c:2143: warning: ignoring return value of write super-ddf.c:2147: warning: ignoring return value of write super-ddf.c:2150: warning: ignoring return value of write super-ddf.c:2162: warning: ignoring return value of write super-ddf.c:2169: warning: ignoring return value of write super-ddf.c:2172: warning: ignoring return value of write super-ddf.c:2176: warning: ignoring return value of write super-ddf.c:2181: warning: ignoring return value of write super-ddf.c:2686: warning: ignoring return value of posix_memalign super-ddf.c:2690: warning: ignoring return value of write super-ddf.c:3070: warning: ignoring return value of posix_memalign super-ddf.c:3254: warning: ignoring return value of posix_memalign bitmap.c:128: warning: ignoring return value of posix_memalign mdmon.c:94: warning: ignoring return value of write mdmon.c:221: warning: ignoring return value of pipe mdmon.c:327: warning: ignoring return value of write mdmon.c:330: warning: ignoring return value of chdir mdmon.c:335: warning: ignoring return value of dup monitor.c:415: warning: rv may be used uninitialized in this function ...some of these like the write() ones are not so trivial so save those fixes for the next patch. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* monitor: protect against CONFIG_LBD=nDan Williams2008-10-151-2/+2
| | | | | | | | md/resync_start reports different terminal values depending on kernel configuration (~0UL versus ~0ULL). Make detection of the resync-complete state more robust by comparing against array size. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Report uuid in --detail --brief for ddf and intelNeilBrown2008-09-181-10/+13
| | | | The uuid is slightly fictitious but needed for array matching.
* Add uuid support for super-intel.NeilBrown2008-09-181-2/+5
| | | | | 'imsm' does not provide any real uuid, so we synthesise one from various stable bits of the superblock.
* Lots of fixes to make incremental assembly of containers work.NeilBrown2008-09-181-15/+21
| | | | | | | | So: mdadm -I /dev/whatever will (if appropriate) add whatever to a container, then start any arrays inside the container.
* Handle incremental assembly of containers.NeilBrown2008-09-181-0/+2
| | | | | | | | | mdadm -I /dev/part-of-container should add that to a container, creating if it needed, and then try to assemble any arrays in the container. Signed-off-by: NeilBrown <neilb@suse.de>
* Move calls to SET_ARRAY_INFO to common helper.NeilBrown2008-09-181-0/+6
| | | | | | | | | | When we assemble an array, there are three different approaches depending on whether metadata is internal or external, and on kernel version. Move all this to a common helper instead of duplicating in 3 places. Signed-off-by: NeilBrown <neilb@suse.de>
* Compile fixes, particularly moving more stuff under MDASSEMBLENeilBrown2008-09-181-6/+12
| | | | Now 'make everything' works again.
* Allow metadata handlers to communicate desired safemode delay via mdinfoDan Williams2008-09-151-0/+2
| | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Fix bug with ddf if devices have different sizes.NeilBrown2008-08-191-0/+1
| | | | | | | | We cannot use the header of the 'best' device to find the sections on the other devices!! Signed-off-by: NeilBrown <neilb@suse.de>
* Provide ddf support for adding a device to an active container.NeilBrown2008-08-191-6/+53
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Extra option for set_array_state: you choose dirty or clean.NeilBrown2008-08-191-1/+8
| | | | | | | | | | | | | | When we first start an array, it might be good to start recovery straight away. That requires setting the array to 'dirty', but only the metadata handler can know if that is required or not. So have a third possible 'consistent' option to set_array_state. Either 'no' or 'yes' or 'you choose'. Return value indicates what was chosen. '1' (no) should be chosen unless there is a good reason. Signed-off-by: NeilBrown <neilb@suse.de>
* Make sure resync_start is initialised properly and maintained properlyNeil Brown2008-07-181-0/+2
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* ddf: endian fixes.Neil Brown2008-07-181-2/+2
| | | | | | | 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>
* Pass 'verbose' flag to validate_geometryNeil Brown2008-07-121-52/+71
| | | | | 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.
* Use O_DIRECT for all IO to devices.Neil Brown2008-07-121-44/+62
| | | | | | | | 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.
* ddf: Set container_member from subarray in getinfo_super.Neil Brown2008-07-121-2/+3
| | | | Also go direct from subarray to text_version.
* Reduce the number of metadata updates done by ddf.Neil Brown2008-07-121-7/+43
| | | | | | | | | 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.
* Remove some noisy printfs.Neil Brown2008-07-121-7/+7
|
* Create arrays via metadata-updateNeil Brown2008-07-121-3/+43
| | | | | Support creating arrays inside an active ddf container by sending a metadata update over a pipe to mdmon.
* Remove the multiple super_switchs for ddf.Neil Brown2008-07-121-152/+78
| | | | | It is simpler if there is just one, and the methods make decisions as appropriate.
* Remove silly convention that major='-1' means 'zero superblock'.Neil Brown2008-07-121-10/+6
| | | | Use 'info pointer is NULL' instead.
* Remove getinfo_super_n and do some other cleaning up.Neil Brown2008-07-121-55/+47
| | | | | Getting close to a sensible description of what some of the superswitch methods are supposed to do!
* External metadata shouldn't set array.*_versionNeil Brown2008-07-121-9/+0
| | | | It doesn't mean anything and is never used.
* Add subarray field to supertype.Neil Brown2008-07-121-0/+12
| | | | | | | | | 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].
* Hide subordinate superswitch structures.Neil Brown2008-07-121-4/+4
| | | | | | 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.
* Remove 'major' from superswitch.Neil Brown2008-07-121-4/+0
| | | | It isn't generally meaningful.
* Assorted cleanups to DDFNeil Brown2008-07-121-132/+157
|
* Always zero a struct ddf_super on allocation.Neil Brown2008-07-121-0/+1
|
* Always initialise a struct super_type to zeroNeil Brown2008-07-121-0/+3
|
* Fix freeing of updates that have been handled by monitor.Neil Brown2008-07-121-2/+2
| | | | | Yes, we do want to free the buf, and the space too if it is still there.
* ddf: fix up validate_geometry to ignore other containersDan Williams2008-06-131-3/+3
| | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ddf: fix 'ddf' pointer corruptionDan Williams2008-06-131-2/+2
| | | | | | hostname[17] = 0 overwrites the last byte of the ddf pointer Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* ddf: convert size paramter to sectors when calling avail_size_ddfDan Williams2008-06-131-1/+1
| | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Add DDF code for activate_spareNeil Brown2008-06-121-2/+231
| | | | Plus various bug fixes etc.
* Some fixes to make failures in ddf get handled properly.Neil Brown2008-06-121-2/+2
|
* Correctly set resync_start when creating an array.Neil Brown2008-06-121-0/+8
|
* DDF: Update array state and disk state properly when adding to a BVDNeil Brown2008-06-121-8/+36
|
* super method for updating ddf metadata.Neil Brown2008-06-121-9/+129
|
* Allow passing metadata update to the monitor.Neil Brown2008-06-121-2/+2
| | | | | | 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.
* Store and recover spare_assign info in DDF.Neil Brown2008-06-121-8/+24
|