summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | Add a missing 'closedir'.NeilBrown2009-09-111-1/+1
| |/ | | | | | | | | | | Thanks to David Binderman for finding and reporting it. Signed-off-by: NeilBrown <neilb@suse.de>
| * super1: remove fd leak when opening /dev/urandomNeilBrown2009-08-131-0/+2
| | | | | | | | | | | | | | | | | | As reported in https://bugzilla.novell.com/show_bug.cgi?id=527722 I forgot to close the fd after reading the random number. Signed-off-by: NeilBrown <neilb@suse.de>
| * Exmaine/brief: put member arrays after container arrays.NeilBrown2009-08-074-4/+34
| | | | | | | | | | | | | | | | | | A previous patch moved move the '--examine --brief' reporting of member arrays to before their containers. This breaks "mdadm -As" assembly. So put them back, but still fix the problem addressed by previous patch. Signed-off-by: NeilBrown <neilb@suse.de>
| * Merge branch 'master' of git://github.com/djbw/mdadmNeilBrown2009-08-0711-54/+209
| |\
| | * Assemble: fix handling of empty containerDan Williams2009-08-041-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # mdadm --create /dev/md/ddf /dev/sd[b-e] -n 4 -e ddf mdadm: container /dev/md/ddf prepared. # mdadm -Ss mdadm: stopped /dev/md126 # mdadm -As mdadm: Container /dev/md/ddf0 has been assembled with 4 drives Segmentation fault Reported-by: Artur Wojcik <artur.wojcik@intel.com> Reported-by: Jacek Danecki <jacek.danecki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| | * imsm: fix spare-uuid assignmentDan Williams2009-07-311-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | imsm spares do not have container membership by default so we associate them with the first container found in the configuration file. Some ARRAY lines do not specify the metadata type so we cannot assume that _cst will always be valid. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| | * platform: relax rom scanning alignment for ahci platformsDan Williams2009-07-313-7/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The PCI-3.0 Firmware specification allows for option-roms to have 512-byte alignment rather than 2048-byte. As there does not appear to be a reliable method to detect a PCI-3.0 compliant BIOS from userspace we allow the imsm platform detection code to presume that a system modern enough to have an Intel AHCI controller does not have dangerous/legacy ISA regions in the option-ROM memory space. An environment variable to disable this behaviour, IMSM_SAFE_OROM_SCAN, is added in case this presumption is ever proven wrong. Reported-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| | * imsm: fix family number handlingDan Williams2009-07-314-16/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The family_number field can change. The option-rom will change the family number when it starts a rebuild process (flags a container for rebuild). This was not seen previously as mdadm would usually start the rebuild process, preserving the family number. This is the mechanism that helps to prevent a prodigal array member from being returned to its original system and cause a rebuild to go in the wrong direction. With the change we will end up with a container that will fail to assemble unless the device with the incompatible family number is left out of the assembly. So, take several actions: 1/ Convert uuid generation to use orig_family_num, being careful to preserve the existing uuid in the case where orig_family_num is not set (i.e. previous mdadm created imsm arrays) 2/ Set orig_family_num at Create. For arrays created by mdadm prior to this release orig_family_num will be zero, so set it to family_num at the first metadata write. 3/ Add checks for orig_family_num to compare_super_imsm 4/ Update the family number when initiating rebuild 5/ The option-rom mixes some random data into the family number, add this functionality to the mdadm implementation. Reported-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| | * imsm: fix activate_spare off-by-oneDan Williams2009-07-311-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The last sector of an array is calculated by start + size - 1. Reported-by: Rafal Marszewski <rafal.marszewski@intel.com> Reported-by: Jarema Bielanski <jarema.bielanski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| | * conditionally update uuids in the map file after Create()Dan Williams2009-07-313-13/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The map file needs to be updated after adding the first member array to an Intel metadata container. The uuid for an imsm container uses the ->family_num field of the metadata. This field is static, but is only set after the first member array has been created. Prior to this all devices are free floating spares and do not have any information that can identify specific container membership. At Create() time we take the uninitialized uuid from ->get_info_super() prior to updating the metadata. So the current result is: # mdadm --create /dev/md/imsm /dev/sd[b-e] -n 4 -e imsm # mdadm --create /dev/md/vol0 /dev/md/imsm -n 4 -l 0 # cat /var/run/mdadm/map md126 /md127/0 3e03aee2:78c3c593:1e8ecaf0:eefb53ed /dev/md/vol0 md127 imsm 53d6f8b1:7a783f24:f30483c5:705c48c7 /dev/md/imsm # mdadm -Ebs ARRAY metadata=imsm UUID=589d2d2c:4221a54d:acb63c06:c3907f52 ARRAY /dev/md/vol0 container=589d2d2c:4221a54d:acb63c06:c3907f52 member=0 UUID=57b89b63:5cd0eae1:17dd26b3:51cc78d4 So, before we write out the new metadata check to see if the member array uuid has changed as a result of this addition. If it has, update its uuid in the map file and flag its parent container for updating. In support of updating the container uuid the semantics of ->write_init_super are changed to clear any metadata specific member array cursors (e.g. ddf_super.currentconf or intel_super.current_vol) such that a subsequent call to ->getinfo_super returns container information. Reported-by: Ignacy Kasperowicz <ignacy.kasperowicz@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| | * imsm: fixup examine_brief to be more descriptive in the container only caseDan Williams2009-07-311-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to creating any arrays in a new container the output from -Ebs for a 4-disk imsm array returns: spares=4 We should at least display that these are imsm spares: ARRAY metadata=imsm spares=4 Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| | * fix examine_brief segfaultDan Williams2009-07-313-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When performing an "-Ebs -e <metadata type>" we segfault because the superblock has been freed too early. We also leak memory for 'ddf' and 'imsm' because, unlike super[01], we do not implicitly free when ->load_super is called on an already loaded supertype. So, fix up imsm and ddf to match type 0 and 1 ->load_super() semantics, and update Examine to not free the superblock until all usages have been exhausted. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| | * fix RebuildMap() to retrieve 'subarray' infoDan Williams2009-07-311-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RebuildMap falsely returns container info for member arrays. Retrieving the subarray and container_dev details prior to ->load_super() changes the result from: md127 imsm 082c6371:74b5ce03:64972e41:6b0860d5 /dev/md/imsm md126 imsm 082c6371:74b5ce03:64972e41:6b0860d5 /dev/md/vol0 ...to: md126 /md127/0 3e03aee2:78c3c593:1e8ecaf0:eefb53ed /dev/md/vol0 md127 imsm 082c6371:74b5ce03:64972e41:6b0860d5 /dev/md/imsm Reported-by: Ignacy Kasperowicz <ignacy.kasperowicz@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| | * teach imsm and ddf what st->subarray means at load_super timeDan Williams2009-07-312-3/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RebuildMap wants to poll through mdstat and retrieve a (kernel name, uuid, user name) tuple for each array. Teach imsm and ddf to honor st->sub_array at ->load_super() time to set their internal subarray pointers to the value specified in st->subarray, or return an error if st->subarray specifies an invalid array. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | Monitor: use pclose rather than fcloseNeilBrown2009-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Using pclose is probably the right thing to do seeing that we used popen, but as there is no clear need to wait for sendmail to finish, it isn't really important. Signed-off-by: NeilBrown <neilb@suse.de>
| * | Examine: make --metadata= work with --briefNeilBrown2009-07-101-2/+4
| |/ | | | | | | | | | | They had different assumptions about the lifetime of 'st'. Signed-off-by: NeilBrown <neilb@suse.de>
| * Examine: fix --examine --brief --verbose on containers.NeilBrown2009-06-042-2/+2
| | | | | | | | | | | | | | | | | | | | | | With --verbose, --examine --brief prints dev= information after the personality has done its bit. But with containers, the member array are printed in between. So in super-ddf and super-intel, move printing of the member arrays to before printing of the container. This avoids confusion. Signed-off-by: NeilBrown <neilb@suse.de>
| * super-intel: fix test on failed_disk_num.NeilBrown2009-06-041-1/+1
| | | | | | | | | | | | | | | | | | | | We sometimes set failed_disk_num to ~0. However we cannot test for equality with that as failed_disk_num is 8bit and ~0 is probably 32bit with lots of 1's. So test if ~failed_disk_num is 0 instead. Reported-By: "Mr. James W. Laferriere" <babydr@baby-dragons.com> Signed-off-by: NeilBrown <neilb@suse.de>
| * Release mdadm-3.0devel-3.0NeilBrown2009-06-0236-2180/+27
| | | | | | | | | | | | | | | | - remove lot of old 'ANNOUNCE' files - trim changelog - update version numbers Signed-off-by: NeilBrown <neilb@suse.de>
| * Merge branch 'master' of git://github.com/djbw/mdadm into devel-3.0NeilBrown2009-06-021-6/+8
| |\
| | * imsm: kill "auto=" in brief_examine_super_imsmDan Williams2009-05-181-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The auto parameter is obsolete after kernel version 2.6.28 as all arrays are partitionable via block device extended minor support. Environments that requre the mdp style of array can always edit the configuration file to specify auto=mdp. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| | * imsm: fix num_domainsDan Williams2009-05-181-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | The 'num_domains' field simply identifies the number of mirrors. So it is 2 for a 2-disk raid1 or a 4-disk raid10. The orom does not currently support more than 2 mirrors, but a three disk raid1 for example would increase num_domains to 3. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | Merge branch 'master' into devel-3.0NeilBrown2009-06-022-8/+21
| |\ \ | | | | | | | | | | | | | | | | | | | | Conflicts: super0.c super1.c
| | * | Monitor: support spare-group manipulation for 1.x metadata.NeilBrown2009-05-124-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code for moving spares around a spare-group currently only works for 0.90 metadata. Generalise it for 1.x metadata as well. Reported-by: "Garth Snyder" <garth@grsweb.us> Signed-off-by NeilBrown <neilb@suse.de>
| | * | Ignore leading zeros in version number information.NeilBrown2009-05-121-3/+6
| | | | | | | | | | | | | | | | --detail sometimes generates leading zero which are just noise.
| * | | Move WaitClean from Monitor.c to sysfs.cNeilBrown2009-06-023-105/+106
| | | | | | | | | | | | | | | | | | | | | | | | That way mdmon doesn't need to include Monitor.o Signed-off-by: NeilBrown <neilb@suse.de>
| * | | Update copyright dates and remove references to @cse.unsw.edu.auNeilBrown2009-06-0228-146/+51
| | | | | | | | | | | | | | | | | | | | | | | | Also removed 'paper' addresses. Signed-off-by: NeilBrown <neilb@suse.de>
| * | | Monitor: reduce default poll interval if mdstat is pollable.NeilBrown2009-06-021-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 2.6.16, mdstat responds to select/poll. So in that case, increase the default poll interval to about 15 minutes. This ensures that the background load is insignificant. Signed-off-by: NeilBrown <neilb@suse.de>
| * | | Monitor: don't get confused if utime is never set.NeilBrown2009-06-021-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | externally managed arrays do not (currently) cause utime in GET_ARRAY_INFO to be updated. So if it is zero, just assume the current time. This will cause GET_DISK_INFO to be called more often, but as we do the scan only every 60 seconds normally, a few extra syscalls isn't going to make a big difference. Signed-off-by: NeilBrown <neilb@suse.de>
| * | | mdadm.8: Man page updatesNeilBrown2009-06-028-241/+481
| | |/ | |/| | | | | | | General review and update of mdadm.8
* | | Fix raid6 error recovery in 'restripe' code.NeilBrown2009-09-251-2/+2
| | | | | | | | | | | | | | | | | | Thanks to Matthias Urlichs for discovering and reporting this. Signed-off-by: NeilBrown <neilb@suse.de>
* | | mdadm.8 : update documentation for new --grow modesNeilBrown2009-08-131-7/+88
| | |
* | | Grow: support restart of new migrations.NeilBrown2009-08-135-32/+270
| | |
* | | Handle extra 'grow' variations.NeilBrown2009-08-115-320/+959
| | | | | | | | | | | | UNFINISHED
* | | restripe: support saving when not all devices are present.NeilBrown2009-07-144-45/+297
| | |
* | | Examine/Detail: report raid6 layoutNeilBrown2009-07-143-0/+20
| | | | | | | | | | | | | | | | | | Somehow this was missing before... Signed-off-by: NeilBrown <neilb@suse.de>
* | | Grow: --size improvements.NeilBrown2009-07-142-3/+18
| | | | | | | | | | | | | | | | | | | | | 1/ allow --size to be given with 'G' or 'T' suffix. 2/ allow size to exceed 32bits, and in that case write through sysfs. Signed-off-by: NeilBrown <neilb@suse.de>
* | | Grow: pass layout as a string rather than a number.NeilBrown2009-07-144-19/+51
| | | | | | | | | | | | | | | | | | | | | | | | This allows the layout to be parsed after the current level of the array is know, so that the level doesn't need to be given (otherwise pointlessly) on the command line. Signed-off-by: NeilBrown <neilb@suse.de>
* | | Remove Manage_reconfing in favour of Grow_reshapeNeilBrown2009-07-143-22/+1
| | | | | | | | | | | | | | | | | | | | | | | | Bother Manage_reconfig and Grow_reshape provide for changing the 'layout' of a faulty array. This is no necessary. So discard Manage_reconfig and just use Grow_reshape Signed-off-by: NeilBrown <neilb@suse.de>
* | | main: factor out code to parse layout for raid10 and faulty.NeilBrown2009-07-143-22/+41
| | | | | | | | | | | | | | | | | | This will soon be called from multiple places. Signed-off-by: NeilBrown <neilb@suse.de>
* | | Grow: support --array-size changesNeilBrown2009-07-135-4/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | With 2.6.30 it is possible to tell the md driver to clip an array to a size smaller than the real size of the array. This option gives access to that feature. The size change does not persist across restarts. Signed-off-by: NeilBrown <neilb@suse.de>
* | | restripe: add support for new layouts including DDFNeilBrown2009-05-251-6/+126
|/ / | | | | | | | | | | | | | | md supports new raid6 layouts to support conversion to and from raid5 and well as DDF. Make sure restripe handles those, including getting the order right for Q-syndrome calculation. Signed-off-by: NeilBrown <neilb@suse.de>
* | Release mdadm-3.0-rc1NeilBrown2009-05-117-5/+148
| |
* | Merge branch 'master' into devel-3.0NeilBrown2009-05-117-36/+39
|\| | | | | | | | | | | | | | | Conflicts: Build.c mdadm.c mdadm.h super1.c
| * re-add error checkNeilBrown2009-05-051-0/+5
| |
| * Fix gcc-4.4 compiler warning.NeilBrown2009-04-292-25/+22
| | | | | | | | | | | | | | | | | | Apparently the dereferencing of a type-punned pointer breaks strict aliasing rules. And we wouldn't want to do that. So just make a different array of the appropriate type and use memcpy. Resolves-Debian-bug: 505375 Signed-off-by: NeilBrown <neilb@suse.de>
| * Makefile: use $(CC) more consistently.NeilBrown2009-04-291-3/+3
| | | | | | | | | | Explicitly calling 'gcc' in some rules makes it hard to test with other compilers.
| * mdadm: allow build to use --sizePaul Clements2009-04-213-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables the --size parameter for build operations. Without this, if you have a raid1, for instance, where the 2 disks are not the exact same size, and you need to build the array but one of the disks is not available right at the moment (maybe it's USB and it's unplugged, or maybe it's a network disk and it's unavailable), then you have to play some weird games to get the array to size correctly (that is, to the size of the smaller of the two components or less). There may be other uses for this too... -- Paul Signed-off-by: NeilBrown <neilb@suse.de>
* | create_mddev: don't replace /dev/mdX with /dev/md/XNeilBrown2009-05-111-1/+4
| | | | | | | | | | | | | | | | If someone creates/assemble an array called "/dev/md0", don't force it to be "/dev/md/0". Doing so isn't really necessary and it likely to confuse people. Signed-off-by: NeilBrown <neilb@suse.de>
* | mapfile - when rebuilding, choose an appropriate name is none is found.NeilBrown2009-05-113-1/+155
| | | | | | | | | | | | | | | | When rebuilding the mapfile (mdadm -Ir), if not appropriate name is found in /dev/md/, try to find an appropriate name, either by looking in mdadm.conf or by using the name in the metadata. Signed-off-by: NeilBrown <neilb@suse.de>