summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Release 3.2.6 - stability releasemdadm-3.2.6mdadm-3.2.xNeilBrown2012-10-257-5/+63
|
* Query: allow member of non-0.90 arrays to be better reported.NeilBrown2012-10-251-3/+7
| | | | | | | | | Currently if a member of a 1.x array is queries, 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-251-1/+1
| | | | | | | | | | 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>
* Monitor: don't complain about non-monitorable arrays in mdadm.confNeilBrown2012-10-241-1/+3
| | | | | | | | | | | | | | If we are asked to monitor a RAID0 or Linear - which cannot be monitored - we complain with "Device Disappeared .... Wrong-Level". However if the RAID0 or Linear is being requested because it is in mdadm.conf then the message is inappropriate and confusing. So track which arrays are added from the config file, and suppress that message in that case. Reported-by: "Johnson Yan" <johnson_yan@usish.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Create new md devices consistentlyJustin Maggard2012-10-241-1/+4
| | | | | | | | | | | | | Creating a new MD device with the name 'd-0' results in some unexpected behavior, since mdadm sees that '-0' is a non-negative integer and therefore makes a "partitionable" device (/dev/md_d0). This is not the expected behavior, since the documentation mentions 'dN' several places, and a reboot brings it up as /dev/md/d-0. Make this consistent by ensuring that the character immediately following 'd' is a digit during creation. Signed-off-by: NeilBrown <neilb@suse.de>
* super0: allow creation of array on 2TB+ devices.NeilBrown2012-10-231-2/+2
| | | | | | | | | | As 'info->size' is signed, it cannot even hold values above 2TB. But it isn't used much. sb->size is the important value and it is unsigned. So use that to check for overflow of size. Reported-by: Eugene San <eugenesan@gmail.com>
* Detail: don't report a faulty device as 'spare' or 'rebuilding'.NeilBrown2012-10-221-1/+2
| | | | | | | | If a device is faulty, then that is all there is too it. Even if it isn't 'removed' yet, it shouldn't be reported as 'spare' or 'rebuilding'. Signed-off-by: NeilBrown <neilb@suse.de>
* Trivial bugfix and spelling fixes.Michael Tokarev2012-10-225-30/+4
| | | | | | | | And here's another trivial bugfix, now for spelling mistakes in various places, authred by Sergey Kirpichev (Cc'ed) and carried in debian mdadm package. Signed-off-by: NeilBrown <neilb@suse.de>
* mdadm: super0: do not override uuid with homehostMichael Tokarev2012-10-221-1/+1
| | | | | | | | | | When --uuid is specified in the command line, even for v0.90 superblock we override last portion of uuid with data from --homehost, which is wrong (and disagrees with the manpage). Only use homehost in super0 if no uuid is specified. Signed-off-By: Michael Tokarev <mjt@tls.msk.ru> Signed-off-by: NeilBrown <neilb@suse.de>
* Fix open_containerNeilBrown2012-10-181-0/+14
| | | | | | | | open_container should open a container which contains the device, but sometimes it would open another volume which contains the device. Be more careful in 'holder' selection. Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: fix a couple of typos with --assume-clean usageNeilBrown2012-10-181-2/+2
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: allow --grow --continue to work for native metadata.NeilBrown2012-10-181-4/+37
| | | | | | | | As it was the code would crash due to "mdstat" being NULL. Code is now more sane, but hasn't been tested on an array that needs to grow. Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: allow --assume-clean to work.NeilBrown2012-10-181-1/+2
| | | | | | | We must avoid setting IMSM_T_STATE_UNINITIALIZED if the array was declared to be clean due to --assume-clean. Signed-off-by: NeilBrown <neilb@suse.de>
* Handles spaces in array names better.NeilBrown2012-10-186-12/+106
| | | | | | | | | | | | 1/ When printing the "name=" entry for --brief output, enclose name in quotes if it contains spaces etc. Quotes are already supported for reading mdadm.conf 2/ When a name is used as a device name, translate spaces and tabs to '_', as well as the current translation of '/' to '-'. Signed-off-by: NeilBrown <neilb@suse.de>
* Add zlib license to crc32.cJes Sorensen2012-10-181-0/+20
| | | | | Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Replace sha1.h with slightly older version.NeilBrown2012-10-181-2/+2
| | | | | | | | | | | | sha1.h claims GPL3+, while sha1.c claims GPL2+. This is inconsistent and technically prevents the whole from being distributed under GPL2. So replace sha1.h with a version from the GCC sources from before Tue Apr 20 08:36:39 2010 when the copyright notice was updated. Reported-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: make warning about old metadata more explicit.NeilBrown2012-10-181-3/+2
| | | | | | | Don't print it just when --verbose is set, and explain how to over-ride it. Signed-off-by: NeilBrown <neilb@suse.de>
* Use --offroot flag when assembling md arrays via --incrmentalNeilBrown2012-09-271-1/+1
| | | | | This ensures that mdmon won't be killed by systemd. Signed-off-by: NeilBrown <neilb@suse.de>
* Fix 'enough' function for RAID10.NeilBrown2012-09-271-3/+4
| | | | | | | | | | | | The 'enough' function is written to work with 'near' arrays only in that is implicitly assumes that the offset from one 'group' of devices to the next is the same as the number of copies. In reality it is the number of 'near' copies. So change it to make this number explicit. Reported-by: Jakub Husák <jakub@gooseman.cz> Signed-off-by: NeilBrown <neilb@suse.de>
* fix segfaults in Detail()Lukasz Dorau2012-09-271-2/+3
| | | | | | | | If disk has been removed, 'st' and 'info' can be NULL. It causes segfault. 'st' and 'info' should be checked against being NULL before being used. Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* mapfile: fix mapfile rebuild for containersNeilBrown2012-09-271-1/+6
| | | | | | | | When recreating the mapfile entry for a container we need to use ->getinfo_super, not ->container_content, just like we do in Detail(). Signed-off-by: NeilBrown <neilb@suse.de>
* find_free_devnum: avoid auto-using names in /etc/mdadm.confNeilBrown2012-09-271-0/+4
| | | | | | | | high-number names like "/dev/md126" shouldn't be in /etc/mdadm.conf, but if they are they should be ignored when choosing an unused number. Signed-off-by: NeilBrown <neilb@suse.de>
* mdmon: allow --takeover when original was started with --offrootNeilBrown2012-09-271-1/+5
| | | | | | | | As --offroot causes ARGV[0] to be changed, we need to be more lenient when checking that the mdmon we are about to kill really is mdmon. i.e. allow name to be "@dmon" instead. Signed-off-by: NeilBrown <neilb@suse.de>
* mdmon: fix arg processing for -aNeilBrown2012-09-271-1/+1
| | | | | | '-a' was not being recognised as an abbreviation for '--all'. Signed-off-by: NeilBrown <neilb@suse.de>
* ddf: hack to fix container recognition.NeilBrown2012-09-271-1/+1
| | | | | | | | | | When adding a spare to a DDF there is some confusion about the 'level' of the container. It is reported by kernel as unknown -1000000. I don't know why this broke but until I figure out why and fix it, this hack gets us going again. Signed-off-by: NeilBrown <neilb@suse.de>
* ddf: allow a non-spare to be used to recovery a missing device.NeilBrown2012-09-271-0/+4
| | | | | | | | | | | | If a DDF has two arrays sharing devices and one device fails, then as soon as the spare is used to recover one of the arrays it isn't spare any more and so is not chosen for the other array. Work around this for now by allowing a non-spare to be used if it has enough space. Reported-by: Albert Pauw <albert.pauw@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Manage: zero metadata before adding to 'external' array.NeilBrown2012-09-271-0/+1
| | | | | | | | | | 'external' arrays don't support --re-add yet so old metadata is no value, and 'ddf' gets confusing in mdmon if old metadata is found. So for now, zero out any old metadata found before adding a spare to an externally-managed array. Reported-by: Albert Pauw <albert.pauw@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
* sha1.h: remove ansidecl.h header inclusionLukasz Dorau2012-09-271-2/+0
| | | | | | | | | Inclusion of the 'ansidecl.h' header requires the 'binutils-devel' package to be installed but is not needed. Signed-off-by: Maciej Patelczyk <maciej.patelczyk@intel.com> Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* udev-rules: prevent systemd from mount devices before they are ready.Harald Hoyer2012-09-271-1/+1
| | | | | | | | | | | | | | In the "add" uevent, ATTR{md/array_state} does not exist, so the next rule does not kick in. When an array is assembled incrementally, systemd might see it before it is ready, try to mount it, fail, and give up. Result is that array doesn't get mounted. If we ask udev to tell systemd that it isn't ready yet in this case, systemd waits until it is ready, and all are happy. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: don't leak memory with fdlist.NeilBrown2012-09-271-0/+1
| | | | | | We should free fdlist when finished with it. Signed-off-by: NeilBrown <neilb@suse.de>
* mdmon: fix arg parsing.NeilBrown2012-09-271-1/+0
| | | | | | | | -t aka --takeover should not be setting container_name. It sets it to NULL which causes failure when you try mdmon --all --takeover Signed-off-by: NeilBrown <neilb@suse.de>
* Monitor: fix reporting for Fail vs FailSpare etc.NeilBrown2012-09-271-27/+12
| | | | | | | | | | | | The tests here were specific to 0.90 metadata and didn't work properly for 1.x metadata, where a device's "number" doesn't change. By checking if this is a new array we can avoid some corner cases. Then we test mostly based on state and not based on 'number' at all. Signed-off-by: NeilBrown <neilb@suse.de>
* Monitor: Report NewArray when an array the disappeared, reappears.NeilBrown2012-09-271-2/+7
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Monitor: fix inconsistencies in values for ->percentNeilBrown2012-09-274-17/+19
| | | | | | | | | | | | | ->percent sometimes stores negative values recording states like 'pending' or 'delayed'. The value '-2' means both 'delayed' and in Monitor, 'unknown'. Also, '-1' has a meaning but not #define. So change the #defines to be prefixed with "RESYNC_", instead of "PROCESS_", add new "_NONE" and "_UNKNOWN", and use correct value in each location. Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: fix: correct checking volume's degradationLukasz Dorau2012-09-271-2/+4
| | | | | | | | | | | | | | | | | | | | We do not check the return value of sysfs_get_ll() now. It is wrong. If reading of the sysfs "degraded" key does not succeed, the "new_degraded" variable will not be initiated and accidentally it can have the value of "degraded" variable. In that case the change of degradation will not be checked. It happens if mdadm is compiled with gcc's "-fstack-protector" option when one tries to stop a volume under reshape (e.g. OLCE). Reshape seems to be finished then (metadata is in normal/clean state) but it is not finished, it is broken and data are corrupted. Now we always check the return value of sysfs_get_ll(). Even if reading of the sysfs "degraded" key does not succeed (rv == -1) the change of degradation will be checked. Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* mdadm: Fix Segmentation fault.majianpeng2012-09-271-1/+3
| | | | | | | | | | | | | In function write_init_super1(): If "rv = store_super1(st, di->fd)" return error and the di is the last. Then the di = NULL && rv > 0, so exec: if (rv) fprintf(stderr, Name ": Failed to write metadata to%s\n", di->devname); will be segmentation fault. Signed-off-by: majianpeng <majianpeng@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
* udev-rules: prevent systemd from mount devices before they are ready.NeilBrown2012-09-271-1/+1
| | | | | | | | | | | When an array is assembled incrementally, systemd might see it before it is ready, try to mount it, fail, and give up. Result is that array doesn't get mounted. If we ask udev to tell systemd that it isn't ready yet in this case, systemd waits until it is ready, and all are happy. Signed-off-by: NeilBrown <neilb@suse.de>
* Create new release: 3.2.5mdadm-3.2.5NeilBrown2012-05-187-5/+37
| | | | | | | Fix a serious regression in 3.2.4 which caused "--add" to often fail. Other minor fixes included. Signed-off-by: NeilBrown <neilb@suse.de>
* Update some device sizes for self tests.NeilBrown2012-05-182-4/+4
| | | | | | | | A recent change means that devices smaller than 1Gig no longer have 1Meg wasted at the start. So we must adjust some sizes again. Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: fix: check if size of expansion is not larger than maximumLukasz Dorau2012-05-181-15/+32
| | | | | | | | | | | | | We do not check if requested size of expansion is larger than maximum available size now. If it is larger the output message is a bit misleading, for example: mdadm: Cannot set size on array members. mdadm: Cannot set device size for /dev/md/vol: Device or resource busy Now we check if requested size of expansion is larger than maximum available size and the appropriate output message was added. Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: fix a typo in fprintf messageLukasz Dorau2012-05-181-1/+1
| | | | | Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* mdadm.conf.5: typo: of -> orNeilBrown2012-05-181-1/+1
| | | | | | Addresses-Debian-bug: 673344 Reported-by: Robert Henney <robh@rut.org> Signed-off-by: NeilBrown <neilb@suse.de>
* RebuildMap: check that container_content returns a valid 'info'.NeilBrown2012-05-171-0/+2
| | | | | | | If it doesn't, just skip that entry. Reported-by: Maciej Naruszewicz <maciej.naruszewicz@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Don't consider disks with a valid recovery offset as candidates for bumping ↵Alexander Lyakas2012-05-151-0/+1
| | | | | | | | | | | | up event count When we are looking for a candidate disk to bump up the event count, we consider only disks that have recovery_start==MaxSector. However, after we find one such disk, we agree to accept more disks having same event count, regardless of their recovery_start. Be consistent and don't accept disks with a valid recovery_start at all. Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: don't print message if unfreezing fails.NeilBrown2012-05-151-2/+0
| | | | | | | | This is most likely to happen if the array has been stopped, in which case the error is pointless. Reported-by: Patrik Horník <patrik@dsl.sk> Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: fix --layout=preserve to match man page.NeilBrown2012-05-151-1/+29
| | | | | | | | | | | I think there was some confusion about what --layout=preserve actually means, but in any case it wasn't doing what the man page says it should. So add some case analysis and make sure it does the right thing, or complains if it cannot. Reported-by: Patrik Horník <patrik@dsl.sk> Signed-off-by: NeilBrown <neilb@suse.de>
* super1: fix choice of data_offset.NeilBrown2012-05-151-15/+16
| | | | | | | | | | | | | | While it is nice to set a high data_offset to leave plenty of head room it is much more important to leave enough space to allow of the data of the array. So after we check that sb->size is still available, only reduce the 'reserved', don't increase it. This fixes a bug where --adding a spare fails because it does not have enough space in it. Reported-by: nowhere <nowhere@hakkenden.ath.cx> Signed-off-by: NeilBrown <neilb@suse.de>
* New sha1.c and sha1.hNeilBrown2012-05-152-64/+109
| | | | | | | | | | | These are from: http://gcc.gnu.org/svn/gcc/branches/cilkplus/include/sha1.h and http://gcc.gnu.org/svn/gcc/branches/cilkplus/libiberty/sha1.c and hopefully avoid aliasing issues. Signed-off-by: NeilBrown <neilb@suse.de>
* Create new release: 3.2.4mdadm-3.2.4NeilBrown2012-05-098-34/+181
| | | | | | Bugfix release Signed-off-by: NeilBrown <neilb@suse.de>
* super-intel.c: Fix resource leak from opendir()Jes Sorensen2012-05-071-0/+1
| | | | | | | | Use closedir() on dirp from opendir() to avoid resource leaking. Acked-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>