summaryrefslogtreecommitdiff
path: root/super-ddf.c
Commit message (Collapse)AuthorAge
* Merge branch 'master' of git://github.com/djbw/mdadm into devel-3.0NeilBrown2009-04-14
|\ | | | | | | | | | | | | | | | | Conflicts: Grow.c mdadm.h sysfs.c Due to independent fixes for the "mdadm hangs if reshape finishes too quickly" problem.
| * imsm: set array size at Create/AssembleDan Williams2009-04-12
| | | | | | | | | | | | | | | | | | | | imsm arrays round down the effective array size to the closest 1 megabyte boundary so teach get_info_super_imsm and sysfs_set_array to set 'md/array_size' if available (and make sure ddf uses the default size). Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | super-ddf: fix compile warnings on ppc64Doug Ledford2009-04-08
| | | | | | | | | | | | | | | | Simple patch to silence some compile warnings that only show up on 64bit arches. Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: fixed 'working_disks' reported by container_content.NeilBrown2009-04-07
| | | | | | | | | | | | | | | | The 'work_disks' number should be the number that is expected, not the number found so far. This is needed for Incremental assembly to start the array at the right time. Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: improve print out of physical devices.NeilBrown2009-04-07
| | | | | | | | | | | | Just add some more space really. Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: fix variable name overloadNeilBrown2009-04-07
| | | | | | | | | | | | | | | | The variable 'i' was being used as a loop variable, and also for something else inside the loop. So make the larger loop have a more meaningful name. Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: make sure Create fails if devices are too small.NeilBrown2009-04-02
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: fix bug with error returns.NeilBrown2009-04-02
|/ | | | | | | | In some cases we should only print an error message if 'devname' is defined. In fact we were only returning the error at all in that case!! Signed-off-by: NeilBrown <neilb@suse.de>
* mdmon: allow incremental assembly of containers.NeilBrown2009-03-10
| | | | | | | | If mdmon sees a device added to a container, it should assume it is a new spare. It could be a part of the array that just hadn't been assembled yet. So check first. Signed-off-by: NeilBrown <neilb@suse.de>
* DDF: fix up container_contentNeilBrown2009-03-10
| | | | | | | If we haven't got hold of all the devices yet, we need to be ready to skip over some while gathering content information. Signed-off-by: NeilBrown <neilb@suse.de>
* ddf: use better random number generation.NeilBrown2009-03-10
| | | | | | use /dev/urandom rather than calls to 'random()' if possible. Signed-off-by: NeilBrown <neilb@suse.de>
* Examine: add examine_export for ddf and avoid crashes.NeilBrown2009-03-09
| | | | | | If the personality doesn't provide export_examine_super, don't crash. Signed-off-by: NeilBrown <neilb@suse.de>
* ddf: fix memory corruption bug.NeilBrown2009-03-09
| | | | | When adding to a point, you don't need to multiple by the size of the pointer - C does that for you!
* DDF: minor formatting improvementNeilBrown2009-03-09
| | | | avoid long lines in --examine output
* Support new raid6 layouts needed for DDFNeilBrown2009-03-09
| | | | | | | | DDF raid6 layouts are subtly different from the standard 'md' layouts. From 2.6.30 the kernel knows about these. Teach mdadm about them, and also allow 'ddf' to set an appropriate default. Signed-off-by: NeilBrown <neilb@suse.de>
* sysfs: allow sysfs_read to detect and drop removed disksDan Williams2009-02-24
| | | | | | | | | | | | | | | All operations that rely on loading from an existing container (like --add) will fail after a disk has been removed. Provide an option to skip missing / offline disks rather than abort. We attempt to do this in the load_super_{imsm,ddf}_all cases when mdmon is running i.e. we already have a consitent version of the metadata running in the system. Otherwise, we fail as normal and let the administrator fix up the container. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Merge branch 'devel' of ↵NeilBrown2008-12-18
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/djbw/mdadm into devel-3.0
| * introduce --detail-platform to display platform raid capabilitiesDan Williams2008-12-08
| | | | | | | | | | | | | | Metadata formats like imsm work in concert with platform firmware and hardware, so provide a way for mdadm to display this info to the user. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | DDF: improve --examine outputNeilBrown2008-12-04
| | | | | | | | | | | | | | Make this more readable and in line with other metadata types by providing a table for the devices. Signed-off-by: NeilBrown <neilb@suse.de>
* | Create: support autolayout when creating in a DDFNeilBrown2008-12-04
|/ | | | | | | | | If, when creating an array, a signal target device is given which is a container, then allow the metadata handler to choose which devices to use. This is currently only supported for DDF. Signed-off-by: NeilBrown <neilb@suse.de>
* allow add_to_super to return errorsDan Williams2008-11-27
| | | | | | 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-04
| | | | | | | 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-04
| | | | | | 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-04
| | | | | | 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-04
| | | | | 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-27
| | | | | | | 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-15
| | | | | | | 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-15
| | | | | | | 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-15
| | | | | | 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-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-15
| | | | | | | | 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-18
| | | | The uuid is slightly fictitious but needed for array matching.
* Add uuid support for super-intel.NeilBrown2008-09-18
| | | | | '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-18
| | | | | | | | 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-18
| | | | | | | | | 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-18
| | | | | | | | | | 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-18
| | | | Now 'make everything' works again.
* Allow metadata handlers to communicate desired safemode delay via mdinfoDan Williams2008-09-15
| | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Fix bug with ddf if devices have different sizes.NeilBrown2008-08-19
| | | | | | | | 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-19
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Extra option for set_array_state: you choose dirty or clean.NeilBrown2008-08-19
| | | | | | | | | | | | | | 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-18
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* ddf: endian fixes.Neil Brown2008-07-18
| | | | | | | 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-12
| | | | | 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-12
| | | | | | | | 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-12
| | | | Also go direct from subarray to text_version.
* Reduce the number of metadata updates done by ddf.Neil Brown2008-07-12
| | | | | | | | | 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-12
|
* Create arrays via metadata-updateNeil Brown2008-07-12
| | | | | 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-12
| | | | | It is simpler if there is just one, and the methods make decisions as appropriate.