summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Allow homehost to be largely ignored when assembling arrays.NeilBrown2009-05-118-25/+132
| | | | | | | | | | | | | | | | | | | | | | | | If mdadm.conf contains HOMEHOST <ignore> or commandline contains --homehost=<ignore> then the check that array metadata mentions the given homehost is replace by a check that the name recorded in the metadata is not already used by some other array mentioned in mdadm.conf. This allows more arrays to use their native name rather than having an _NN suffix added. This should only be used during boot time if all arrays required for normal boot are listed in mdadm.conf. If auto-assembly is used to find all array during boot, then the HOMEHOST feature should be used to ensure there is no room for confusion in choosing array names, and so it should not be set to <ignore>. Signed-off-by: NeilBrown <neilb@suse.de>
* util: fix test for text_versionNeilBrown2009-05-111-1/+4
| | | | | | | | as text_version is a char array (not a pointer), testing the address against NULL is the wrong thing to do. Test the content instead. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble/Incr : minor tidy up of setting 'trustworthy'.NeilBrown2009-05-112-10/+6
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* config: allow Array line to contain array name without /dev/md/ prefix.NeilBrown2009-05-113-8/+55
| | | | | | | | | | | | | | | For consistency with --create and --assemble, allow the array name given in mdadm.conf to exclude the "/dev/md/" prefix. So e.g. ARRAY home uuid=whatever is treated like ARRAY /dev/md/home uuid=whatever Also exclude names which create_mddev will reject. Signed-off-by: NeilBrown <neilb@suse.de>
* Fix tests on ->container and ->memberNeilBrown2009-05-112-3/+3
| | | | | | | | For container= and member= to be effective in an mdadm.conf line they must both be present. So when checking for their absence we need container != NULL || member != NULL. Signed-off-by: NeilBrown <neilb@suse.de>
* Make --brief even briefer.NeilBrown2009-05-117-23/+31
| | | | | | | | | | | | | Because ---examine --brief, or --detail --brief are often used to create mdadm.conf, and because people don't want to have to update their mdadm.conf unnecessarily, we don't want to include information that might change. And now that level changing is supported, that is almost everything but UUID. So move some more fields into the "Only print with --verbose" class. Signed-off-by: NeilBrown <neilb@suse.de>
* mdadm.8 general updatesNeilBrown2009-05-111-42/+8
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* conf/assemble: new config line "auto".NeilBrown2009-05-116-3/+116
| | | | | | | | | | | | | | | | | | | The line 'auto' in mdadm.conf can be used to disable assembly of specific metadata types, or of all arrays. This does not affect assembly of arrays listed in mdadm.conf or on command line. auto -all will disable all auto-assembly. auto -ddf will cause mdadm to ignore ddf arrays that are not explicitly mentioned, and auto assemble anything else it finds. Signed-off-by: NeilBrown <neilb@suse.de>
* config: support "ARRAY <ignore> ..." lines in mdadm.confNeilBrown2009-05-116-2/+31
| | | | | | | | | | | | | | Sometimes we want to ensure particular arrays are never assembled automatically. This might include an array made of devices that are shared between hosts. To support this, allow ARRAY lines in mdadm.conf to use the word "ignore" rather than a device name. Arrays which match such lines are never automatically assembled (though they can still be assembled by explicitly giving identification information on the mdadm command line. Signed-off-by: NeilBrown <neilb@suse.de>
* assemble: support arrays created with --homehost=anyNeilBrown2009-05-112-3/+5
| | | | | | | | | | | | | If an array is created with --homehost=any, then --assemble and --incremental will treat it as being local to 'this' host, no matter what the name of this host is. This is useful for array that will be given unique names and be moved between machines. This needs to be documented. Signed-off-by: NeilBrown <neilb@suse.de>
* create_dev - allow array names like mdX and /dev/mdX to appear 'numeric'NeilBrown2009-05-111-3/+11
| | | | | | | | | | | | | | When choosing the minor number to use with an array, we currently base the number of the 'name' stored in the metadata if that name is numeric. Extend that so that if it looks like a number md device name (/dev/md0 or just md0 or even /dev/md/0), then we use the number at the end to suggest a minor number. The means that if someone creates and array with "--name md0" or even "--name /dev/md0" it will continue to do what they expect. Signed-off-by: NeilBrown <neilb@suse.de>
* Wait for POLLPRI on /proc or /sys files.NeilBrown2009-04-143-4/+14
| | | | | | | | | | | | | From 2.6.30, /proc/mounts and various /sys files will probably always returns 'readable' to select, so we will need to wait on POLLPRI to get the 'new data is available' signal. When using select, this corresponds to an 'exception', so adjust calls to select accordingly. In one case we sometimes wait on a socket and sometime on /proc/mounts, so we need to test which. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'master' of git://github.com/djbw/mdadm into devel-3.0NeilBrown2009-04-147-54/+162
|\ | | | | | | | | | | | | | | | | Conflicts: Grow.c mdadm.h sysfs.c Due to independent fixes for the "mdadm hangs if reshape finishes too quickly" problem.
| * mdmon: fix resync completion detectionDan Williams2009-04-121-2/+4
| | | | | | | | | | | | | | | | | | Starting with 2.6.30 the md/resync_start attribute will no longer return a non-sensical number when resync is complete, instead it now returns 'none'. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * Grow: fix hang when reshape completes too fastDan Williams2009-04-123-0/+30
| | | | | | | | | | | | | | | | | | | | | | For short reshapes the kernel may be done before mdadm can check that progress has passed the critical section. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * RebuildMap: handle missing disksDan Williams2009-04-121-1/+4
| | | | | | | | | | | | | | | | | | When rebuilding the map file tolerate missing/offline disks, otherwise we will segfault on the NULL return from sysfs_read. Reported-by: Jacek Danecki <jacek.danecki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * imsm: add the ddf fieldDan Williams2009-04-121-1/+2
| | | | | | | | | | | | | | | | | | This field is always one in arrays created by the Windows driver / OROM, not sure why... Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * imsm: round down array size at CreateDan Williams2009-04-121-0/+4
| | | | | | | | | | | | | | | | | | | | Store the 1MB rounded down size of the array at create time. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * imsm: set array size at Create/AssembleDan Williams2009-04-124-0/+21
| | | | | | | | | | | | | | | | | | | | 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>
| * imsm: turn off curr_migr_unit updatesDan Williams2009-04-121-8/+3
| | | | | | | | | | | | | | | | | | | | | | New documentation shows that this field is not equivalent to md/resync_start. Disable updates until full support can be developed. Writing '0' when a migration starts/re-starts remains correct. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * imsm: defend against unsupported migrations (temporary)Dan Williams2009-04-121-1/+13
| | | | | | | | | | | | | | | | | | | | | | Until support for higher order migrations (online capacity expansion, raid level migration, chunk size migration...) are implemented do not allow arrays in these states to be assembled. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * imsm: add 'verify', 'verify with fixup', and 'general' migration typesDan Williams2009-04-121-12/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | imsm distinguishes parity initialization from parity checking in the metadata. Older option roms marked the repair operation with the 'verify' type and a 'with fixup' flag in the raid device 'status' field. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * imsm: fix imsm_map.num_domainsDan Williams2009-04-121-5/+6
| | | | | | | | | | | | | | | | | | | | 'num_domains' is the number of parity domains. I.e. 2 in the raid10 case (2-mirrors), while raid0 through raid5 have 1 parity domain (even though raid0 does not have parity). Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * imsm: ensure mpb buffer is zeroedDan Williams2009-04-121-2/+5
| | | | | | | | | | | | | | | | | | Don't leak unitialized data into the mpb. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * imsm: support --examine --exportDan Williams2009-04-111-0/+16
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * imsm: make uuid separator consistent with ddfDan Williams2009-04-111-6/+6
| | | | | | | | | | | | | | | | '-' to ':' Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * imsm: extract right-most whitespace stripped serial numberDan Williams2009-04-081-16/+27
| | | | | | | | | | | | | | | | | | According to new documentation the metadata expects that all whitespace (characters <= 0x20) are stripped from the incoming serial number. If the length remains longer than MAX_RAID_SERIAL_LEN then only the right-most characters are preserved. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | udev rules fix for partitions.NeilBrown2009-04-141-0/+4
| | | | | | | | | | | | | | | | | | | | sysfs directories for partitions do not have md/* files, but should not for that reason be ignored. Thanks to Michal Soltys for original fix. Signed-off-by: Michal Soltys <soltys@ziu.info> Signed-off-by: NeilBrown <neilb@suse.de>
* | mapfile: optionally store map file in /devNeilBrown2009-04-141-44/+51
| | | | | | | | | | | | | | | | | | | | | | During early boot, /var/run may not exist or be writable. If that happens, sore the mapfile (which is very important for incremental assembly) in /dev (which should exist for udev). Thanks to Doug Ledford <dledford@redhat.com> for identify this problem and suggesting a solution. Signed-off-by: NeilBrown <neilb@suse.de>
* | tests: basic ddf testsNeilBrown2009-04-141-0/+76
| | | | | | | | | | | | | | Test script to create a ddf with three different member arrays, and assemble it in a variety of ways. Signed-off-by: NeilBrown <neilb@suse.de>
* | tests: add some simple data integrity tests for raid5/raid6NeilBrown2009-04-142-0/+82
| | | | | | | | | | | | Make sure the data is preserved even when the array is degraded. Signed-off-by: NeilBrown <neilb@suse.de>
* | .gitignore updateNeilBrown2009-04-141-0/+4
| | | | | | | | | | | | Add a few more generated files to .gitignore Signed-off-by: NeilBrown <neilb@suse.de>
* | incremental_container: preserve 'in_sync' flag when adding to existing array.NeilBrown2009-04-146-7/+13
| | | | | | | | | | | | | | | | | | | | | | When building container members with -IR, we need to ensure that devices added to an active array preserve the 'in_sync' status so they don't needlessly get rebuilt. So allow sysfs_add_disk to do this (only works in kernels since 2.6.30) and pass the relevant flag down. Signed-off-by: NeilBrown <neilb@suse.de>
* | mdadm udev rules changeDoug Ledford2009-04-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm not attaching a patch for this because it's so simple. Long story short, watching both add and change events in udev rules is bad for md devices. Specifically, the kernel will generate a change event on things like array stop, and on things like fdisk close. In the case of array stop, it can result in the array being assembled again immediately. In the case of fdisk close, the situation is worse. Let's say you stop all the md devices on some block device in order to repartition. You run fdisk, change the partition table, then issue a write of the table. The write of the table triggers the change event *before* the kernel updates the partition table in memory for the block device, causing udev to rerun the incremental rules on the old partition table and restart all the arrays you just stopped with the old partition table layout, at which point the kernel is unable to reread the partition table. So, once you've enable incremental assembly, it becomes apparent that what we really want is to only start devices on add, not on add|change. -- Doug Ledford <dledford@redhat.com>
* | super-ddf: fix compile warnings on ppc64Doug Ledford2009-04-081-3/+4
| | | | | | | | | | | | | | | | 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>
* | Incremental - avoid NULL dereference.NeilBrown2009-04-071-25/+27
| | | | | | | | | | | | | | There structure returned by sysfs_read might not have any 'devs', don't assume it does. Signed-off-by: NeilBrown <neilb@suse.de>
* | test: minor fixesNeilBrown2009-04-071-0/+2
| | | | | | | | | | | | | | | | - allow core files to be dumped. - modprobe md_mod if needed to write to /sys/module/md_mod/parameters/.... Signed-off-by: NeilBrown <neilb@suse.de>
* | Incremental: be more relaxed about member arrays not completely assembling.NeilBrown2009-04-071-7/+10
| | | | | | | | | | | | | | During incremental assembly, if the member array doesn't assemble properly (yet), that isn't an error. Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: call map_update even when not starting the array.NeilBrown2009-04-071-4/+7
| | | | | | | | | | | | | | For incremental assembly to work, we need to keep the 'map' up-to-date even when not starting the array yet. Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: fixed 'working_disks' reported by container_content.NeilBrown2009-04-071-2/+2
| | | | | | | | | | | | | | | | 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-071-4/+4
| | | | | | | | | | | | Just add some more space really. Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: fix variable name overloadNeilBrown2009-04-071-4/+5
| | | | | | | | | | | | | | | | 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>
* | wait_for improvement.NeilBrown2009-04-076-12/+19
| | | | | | | | | | | | | | | | wait not only for the name to appear, but for it to refer to the correct device. Sometimes old symlinks left lying around can be confusing. Signed-off-by: NeilBrown <neilb@suse.de>
* | config: treat "container=" and "member=" and providing the required identity ↵NeilBrown2009-04-061-1/+3
| | | | | | | | | | | | information. Signed-off-by: NeilBrown <neilb@suse.de>
* | Detail: use meaningful names with --scan.NeilBrown2009-04-061-2/+9
| | | | | | | | | | | | | | | | | | | | | | When reporting "--detail --scan", use names like /dev/md/foo where available rather than /dev/md/127 This is particularly needed for containers where the member arrays will report "container=/dev/md/foo" and we want the container to have the same name. Signed-off-by: NeilBrown <neilb@suse.de>
* | Create: round to chunk sizeNeilBrown2009-04-061-0/+2
| | | | | | | | | | | | | | There are probably other places where rounding size to chunksize is needed, or useful, but this is a good start. Signed-off-by: NeilBrown <neilb@suse.de>
* | test: support testing DDFNeilBrown2009-04-061-3/+8
| | | | | | | | | | | | | | | | DDF requires larger devices as 32Meg is reserved. So allocated larger loop devices for DDF tests. Signed-off-by: NeilBrown <neilb@suse.de>
* | util.c: use correct range for minor numbers when finding free device.NeilBrown2009-04-061-1/+1
| | | | | | | | | | | | Minor numbers are 20 bits, not 22. So when looking for a free, high minor number, try (1<<20)-1, not (1<<22)-1.
* | ddf: make sure Create fails if devices are too small.NeilBrown2009-04-021-0/+2
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: fix bug with error returns.NeilBrown2009-04-021-6/+4
| | | | | | | | | | | | | | | | 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>