summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
...
* DDF: container_content_ddf: handle RAID layout for RAID10mwilck@arcor.de2013-03-04
| | | | | | | This patch adds basic handling for the special case of RAID10. Signed-off-by: Martin Wilck <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
* DDF: container_content_ddf: check for secondary RAIDmwilck@arcor.de2013-03-04
| | | | | | | | | | | | Check for supportable secondary RAID configurations. There is currently only one: RAID 10, if the stripe sizes and Basic volume sizes are all equal. With this patch, mdadm will not try to start unsupported secondary RAID level configurations any more. Signed-off-by: Martin Wilck <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
* DDF: container_content_ddf: change array disk search loopmwilck@arcor.de2013-03-04
| | | | | | | | | | | When searching for container elements, loop over the known phys disks rather than the elements of the current configuration. This patch changes nothing in the logic or return value of the code. It just prepares extended logic for handling RAID10. Signed-off-by: Martin Wilck <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
* DDF: load_ddf_local: store VD conf for other BVDsmwilck@arcor.de2013-03-04
| | | | | | | | Store VD config for other BVDs in the other_bvds array. This allows handling secondary RAID levels in container_content_ddf. Signed-off-by: Martin Wilck <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
* DDF: added other_bvd to struct vclmwilck@arcor.de2013-03-04
| | | | | | | | The VD config structures of different BVDs in the same SVD may be different. This pointer stores the other BVDs. Signed-off-by: Martin Wilck <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
* DDF: increase seq number when writing meta datamwilck@arcor.de2013-03-04
| | | | | | | | | | | Cleanly increase the seq number when the DDF structures are written, instead of always setting it back to 1. Also, make sure that the sequential number of all headers and VD conf records is the same. Signed-off-by: Martin Wilck <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
* DDF: use existing locations for primary and secondary DDF structuremwilck@arcor.de2013-03-04
| | | | | | | | | | | | | | | | Some RAID BIOSes apparently use hard-coded LBA offsets (presumably from the end of the disk) for the primary and secondary DDF structure, ignoring the values given in the DDF anchor. This is broken BIOS behavior, but it will cause any changes made by MD (e.g. setting the init_state flag after a full initialization) to be "forgotten" after the next reboot. This patch fixes this by using the exiting LBA locations if available. Verified that this fixes MD+LSI Mega Software RAID BIOS. Signed-off-by: Martin Wilck <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
* DDF: cleanly save the secondary DDF structuremwilck@arcor.de2013-03-04
| | | | | | | | | So far, mdadm only saved the header of the secondary structure. With this patch, the full secondary DDF structure is saved consistently, too. Some vendor DDF implementations need it. Signed-off-by: Martin Wilck <mwilck@arcor.de> Signed-off-by: NeilBrown <neilb@suse.de>
* Discard devnum in favour of devnmNeilBrown2013-02-21
| | | | | | | | | | | | | | We widely use a "devnum" which is 0 or +ve for md%d devices and -ve for md_d%d devices. But I want to be able to use md_%s device names. So get rid of devnum (a number) and use devnm (a 32char string). eg. md0 md_d2 md_home Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: fix problem with reshaping RAID4 to RAID0.NeilBrown2013-02-21
| | | | | | | | | As 'layout' doesn't map neatly from RAID4 to RAID5, we need to set it correctly for RAID4. Also, when no reshape is needed we should set re->level to the final desired level. Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: disallow --size changes on RAID0 and Linear.NeilBrown2013-02-21
| | | | | | These aren't meaningful and must be disabled. Signed-off-by: NeilBrown <neilb@suse.de>
* udev: Fix order of execution of the md rulesThomas Bächler2013-02-11
| | | | | | | | | | | Right now, the rules that run blkid on raid arrays are executed after the assembly rules. This means incremental assembly will always fail when raid arrays are again physical components of raid arrays. Instead of simply reversing the order, split the rules up into two files, one dealing with array properties and one dealing with assembly. Signed-off-by: NeilBrown <neilb@suse.de>
* Modernize udev rulesThomas Bächler2013-02-11
| | | | | | | * $tempnode is deprecated, use $devnode * blkid -o udev output is deprecated, use IMPORT{builtin}="blkid" instead Signed-off-by: NeilBrown <neilb@suse.de>
* mdadm.h: fix ugly glibc specific ifdefferyJohn Spencer2013-02-10
| | | | | | | | the code that was exposed on anything else than dietlibc and klibc is entirely glibc specific and broke the build on musl libc. Signed-off-by: John Spencer <maillist-mdadm@barfooze.de> Signed-off-by: NeilBrown <neilb@suse.de>
* platform-intel: canonicalize_file_name() is not portableJohn Spencer2013-02-10
| | | | | | | | | | | | | this is a GLIBC specific feature and should not be used. according to its manpage: "The call canonicalize_file_name(path) is equivalent to the call realpath(path, NULL)." thus, we use realpath so it works everywhere. Signed-off-by: John Spencer <maillist-mdadm@barfooze.de> Signed-off-by: NeilBrown <neilb@suse.de>
* make --update=homehost work againNeilBrown2013-02-10
| | | | | | | | | | Commit 1e2b276535cea41c348292a019bdda8a58cb1679 (Report error in --update string is not recognised) broke homehost updating functionality because it depended on each string comparison being done even after we already found a match. Make it work again by restructuring code. Reported-by: (and original version by) Justin Maggard <jmaggard10@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Avoid using BLKFLSBUF.NeilBrown2013-02-05
| | | | | | | | | | | Now that we use O_DIRECT for all device IO, BLKFLSBUF is not needed to ensure we get current data, and it can impose a cost if any flush-out is needed. So remove it. To be safe, add O_DIRECT to one place where it isn't currently used: when reading a bitmap. Signed-off-by: NeilBrown <neilb@suse.de>
* Detail: print correct size for large external-metadata arrays.NeilBrown2013-02-05
| | | | | | | | If externally menaged metadata is in use, array.major_version will be zero, so the test here to consider using get_component_size() is wrong. So if sra is present, use the major_version from there. Signed-off-by: NeilBrown <neilb@suse.de>
* mdmon: add --foreground optionNeilBrown2013-02-05
| | | | | | | | While not strictly necessary for systemd, it is cleaner to avoid forking when running from a management daemon. So add a --foreground option to mdmon. Signed-off-by: NeilBrown <neilb@suse.de>
* In case launching mdmon fails, print an error message before exitingJes Sorensen2013-02-05
| | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Add support for launching mdmon via systemctl instead of fork/execJes Sorensen2013-02-05
| | | | | | | | | | If launching mdmon via systemctl fails, we fall back to the old method of fork/exec. This allows for having mdmon launched via systemctl which avoids problems with it getting killed by systemd due to it ending up in the parent's cgroup (udev). Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Remove --offroot argument and default to always setting argv[0] to @Jes Sorensen2013-02-05
| | | | | | | | | | | We still allow --offroot to be given - for compatibility with scripts - but ignore it. The whole point of --offroot is to get systemd to not auto-kill mdmon, and we always want that. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* mdadm.conf.5: clarify connection between action=re-add and bitmaps.NeilBrown2013-01-21
| | | | | | | | action=re-add will only re-add a recently removed device if a bitmap is present. Otherwise a force-space is needed. Signed-off-by: NeilBrown <neilb@suse.de>
* dev_open - don't bother trying map_devNeilBrown2013-01-10
| | | | | | | | map_dev can be slow, and doesn't really provide a better result than just creating a temporary device. So discard it and use mknod/open/unlink to open a major:minor device. Signed-off-by: NeilBrown <neilb@suse.de>
* platform-intel - cache 'intel_devices' for a few seconds.NeilBrown2013-01-07
| | | | | | | | | find_intel_devices() has take a little while to run as it scans some directory tree, and the result isn't likely to change often. So cache the value and only discard it after 10 seconds. Signed-off-by: NeilBrown <neilb@suse.de>
* conditionally remove map_dev from find_free_devnumNeilBrown2013-01-07
| | | | | | | | | map_dev can be slow so it is best to not call it when not necessary. The final test in "find_free_devnum" is not relevant when udev is being used, so remove the test in that case. Signed-off-by: NeilBrown <neilb@suse.de>
* MISC: Add --examine-badblocks optionNeilBrown2012-12-05
| | | | | | This will list the contents of the bad-blocks log, if one is present. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: fix spelling: report_missmatch -> report_mismatchNeilBrown2012-12-05
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: Don't auto-assemble arrays which conflict with mdadm.confNeilBrown2012-12-05
| | | | | | | | | | | | | When auto-assembling we might find an array which appear in mdadm.conf. This can happen if the array (based on UUID) doesn't match what is in mdadm.conf. For consistency we should avoid auto-assembling such an array just as we avoid regular-assembling of the array. Reported-by: Ross Boylan <ross@biostat.ucsf.edu> Signed-off-by: NeilBrown <neilb@suse.de>
* Manage: Add support for --re-add faultyNeilBrown2012-11-28
| | | | | | | | | mdadm /dev/mdXX --re-add faulty will identify any faulty devices in the array, remove them, and --re-add them. Signed-off-by: NeilBrown <neilb@suse.de>
* Fix "--remove faulty" and similar commands.NeilBrown2012-11-28
| | | | | | | | | | | A recent change to improve error messages for subdev management broken all use cases were device names like %d:%d were used. Re-arrange the code again so we use dev_open first - which understands those names - and then only try 'stat' if that failed. The important thing is to base the 'Cannot find' message on the result of 'stat', not on the result of 'open'. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: ensure that <ignore>d arrays are not auto-assembled.NeilBrown2012-11-22
| | | | | | | | | | | It isn't enough to simply not assemble arrays found to be called <ignore>, as the final stage of auto-assemble doesn't check for names in mdadm.conf. So add a check to Assemble, similar to the check in Incremental() Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: NeilBrown <neilb@suse.de>
* conf: allow multiple arrays to be <ignore>dNeilBrown2012-11-22
| | | | | | | | | | | We currently complain if mdadm.conf contains multiple definitions for the same name. Unfortunately this stops multiple arrays from being <ignored>d. So exclude "<ignore>" from the duplicate-names test. Reported-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: NeilBrown <neilb@suse.de>
* Allow --wait to wait for delayed resync.NeilBrown2012-11-22
| | | | | | | | If a resync is delayed, then e->percent will be negative but not RESYNC_NONE. In that case we still want to wait. Reported-by: Ross Boylan <ross@biostat.ucsf.edu> Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: fix bug when multiple arrays present.NeilBrown2012-11-22
| | | | | | | | | | commit 1f9b0e2845e1ec22dc24dcef275a733c09ff2edd Grow - be careful about 'delayed' reshapes. Introduced a bug where a list of devices longer than 1 would cause an infinite loop. Oops. Signed-off-by: NeilBrown <neilb@suse.de>
* Makefile: remove "sh" from instructions for running 'test'.NeilBrown2012-11-20
| | | | | | | | 'test' is really a bash script more than an 'sh' script, so don't say "run 'sh ./test'", just say "run './test'". Reported-by: Gilles Espinasse <g.esp@free.fr> Signed-off-by: NeilBrown <neilb@suse.de>
* Grow.c: fix uninitialized variables compilation-time errorLukasz Dorau2012-11-20
| | | | | | | | | | | | | | | It fixes the following uninitialized variables compilation-time error: WARN - Grow.c: In function ‘reshape_array’: WARN - Grow.c:2413:21: error: ‘min_space_after’ may be used uninitialized in this function [-Werror=maybe-uninitialized] WARN - Grow.c:2376:39: note: ‘min_space_after’ was declared here WARN - Grow.c:2414:22: error: ‘min_space_before’ may be used uninitialized in this function [-Werror=maybe-uninitialized] WARN - Grow.c:2376:21: note: ‘min_space_before’ was declared here WARN - cc1: all warnings being treated as errors WARN - make: *** [Grow.o] Error 1 It occurs during compilation of mdadm on Fedora 17. Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Keep track on which kernel the test suite has runGilles Espinasse2012-11-20
| | | | | Signed-off-by: Gilles Espinasse <g.esp@free.fr> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: Forbid spanning between multiple controllers.Marcin Tomczak2012-11-20
| | | | | | | | | | Attaching disks to multiple controllers of the same type has been allowed so far. Now spanning between multiple controllers is disallowed at all by IMSM metadata. Signed-off-by: Marcin Tomczak <marcin.tomczak@intel.com> Reviewed-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Create.c: check if freesize is equal 0Lukasz Dorau2012-11-20
| | | | | | | | "freesize" can be equal 0, particularly after rounding to the chunk's size. Creating should be aborted in such case. Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: fix call to wait_forNeilBrown2012-11-20
| | | | | | | | | Recent patch closed 'mdfd' before calling wait_for, which means it doesn't work. Put the close back in the right place. Signed-off-by: NeilBrown <neilb@suse.de>
* test: remove unnecessary bash-ism.NeilBrown2012-11-20
| | | | | | | Bash allows '-' in function names, but other shells don't. So use '_' - always safe. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: Fix critical-section-recovery when assembling a growing array.NeilBrown2012-11-20
| | | | | | | | | | | commit aacb2f816afbddf56c406039b8e2e6c0dbc8a8a0 Assemble: add support for replacement devices. broke the restoring of the 'critical section' because it messed up the list of file descriptors passed to Grow_restart. Put it back the way it should be. Signed-off-by: NeilBrown <neilb@suse.de>
* Incremental: allow recently removed device to be added as a spare.NeilBrown2012-11-20
| | | | | | | | | | | | | Currently, action=force-spare isn't effective at all as I'm not sure what is really sensible. This patch allows a device that was part of an array, but has been removed, to be added as a spare of passed to --incremental while force-spare is active. If it is can be re-added, that done first. If it fails, we add it as a spare. Signed-off-by: NeilBrown <neilb@suse.de>
* test: add --disable-integrity switch.NeilBrown2012-11-20
| | | | | | | The integrity tests are very slow and aren't always needed. So make them optional. Signed-off-by: NeilBrown <neilb@suse.de>
* IMSM - allow assembling any imsm array even without OROM.NeilBrown2012-11-20
| | | | | | | | | | | | | | | | It is important to check for compatibility with 'platform' or Option ROM when creating or changing and array. However there is no real need when simply assembling the array. On some systems there are situations where the platform information is not available. e.g. on some UEFI systems, UEFI is not available during 'kdump' handling. This makes it impossible to assemble an IMSM array to receive the dump. So remove the requirements that the platform be visible to assemble an IMSM array. Signed-off-by: NeilBrown <neilb@suse.de>
* Tests: adjust for recent changes.NeilBrown2012-11-20
| | | | | | | | | | | | commit cb19a251a581fe78dcddd1d95dca4d8cb7664819 super1: reserve at least 2 chunks for reshape headroom. reserved more space in a RAID5, so we need to update to array sizes when reshaping. Also make sure reshape tests we change the shape: raid5->raid1 was failing and we didn't notice. Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: fix reshape from RAID5 to RAID1.NeilBrown2012-11-20
| | | | | | | | | | | Commit 5da9ab9874cb5896023afae1462550d83a869831 Grow_reshape re-factor in mdadm-3.2 broke conversion from RAID5 and RAID1 - and we never noticed. This fixes it. Signed-off-by: NeilBrown <neilb@suse.de>
* Query: allow member of non-0.90 arrays to be better reported.NeilBrown2012-10-25
| | | | | | | | | Currently if a member of a 1.x array is queried, mdadm will fail to find the name of the active md array if there is one. Change the lookup to use the mapfile - now it works. Signed-off-by: NeilBrown <neilb@suse.de>
* Query: don't be confused by partition tables.NeilBrown2012-10-25
| | | | | | | | | | Now that we recognise partition tables as a sort of metadata we need to be careful in --query not to say that a device with a partition table looks like a device in an array. Testing ->compare_super for NULL is an easy way to do that. Signed-off-by: NeilBrown <neilb@suse.de>