summaryrefslogtreecommitdiffstats
path: root/mdadm.h
Commit message (Collapse)AuthorAgeFilesLines
...
* | sysfs: allow sysfs_read to detect and drop removed disksDan Williams2009-02-241-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 'master' into devel-3.0NeilBrown2009-02-021-2/+5
|\|
| * Typo in earlier patch : asprintf -> vasprintfDustin Kirkland2009-02-021-1/+1
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
| * mdadm fix compilation for uClibcBernhard Reutner-Fischer2009-02-021-1/+4
| | | | | | | | | | | | | | | | | | | | | | 2008-12-08 Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> * Makefile (dadm.uclibc): Remove misspelled and unneeded rule. * md5.h: Include stdint.h for uClibc. * mdadm.h: uClibc defines __UCLIBC__. If uClibc has LFS off then use lseek instead of lseek64. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* | Create: warn when a metadata format's platform components are missingDan Williams2009-01-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the metadata handler can not find its platform support components then there is no way for it to verify that the raid configuration will be supported by the option-rom. Provide a generic method for metadata handlers to warn the user that the array they are about to create may not work as intended with a given platform. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Create: allow per-metadata default layoutsDan Williams2009-01-201-0/+2
| | | | | | | | | | | | | | | | Let handlers specifiy their own defaults, specifically needed for the imsm-raid5 case where mdadm defaults to 'ls' and imsm to 'la'. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Merge branch 'master' into scratch-3.0NeilBrown2009-01-081-0/+11
|\| | | | | | | | | | | | | Conflicts: Assemble.c config.c
| * Fail overtly when asprintf fails to allocate memoryDustin Kirkland2009-01-081-0/+11
| | | | | | | | | | | | .. rather that causing a less-obvious violation of segments. Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'devel' of ↵NeilBrown2008-12-181-0/+6
|\ \ | | | | | | | | | 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-081-0/+6
| | | | | | | | | | | | | | | | | | | | | 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>
* | | Create: support autolayout when creating in a DDFNeilBrown2008-12-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | | Change 'size' argument to validate_geometry to be sectors, not KNeilBrown2008-12-041-0/+1
|/ / | | | | | | | | | | That way it is the same a *freesize, and generally less confusing. Signed-off-by: NeilBrown <neilb@suse.de>
* | allow add_to_super to return errorsDan Williams2008-11-271-1/+1
| | | | | | | | | | | | Prepare add_to_super to validate disks against the platform capabilities Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: pass symbolic name to mdmon instead of device name.NeilBrown2008-11-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Now that names in /dev are usually created (eventually) by udev, it isn't really safe to rely in finding a name in /dev to pass to mdmon to identify which array to monitor. And it isn't really necessary to have a name in /dev. So just pass the symbolic name, e.g. md127 or md123. Change util.c to pass that name, and change mdmon to process the name sensibly. Signed-off-by: NeilBrown <neilb@suse.de>
* | Wait for name to appear after create/assemble etc.NeilBrown2008-11-041-0/+1
| | | | | | | | | | | | | | We don't really want mdadm to exit until udev has created the names in /dev. So wait. Signed-off-by: NeilBrown <neilb@suse.de>
* | mapfile: validate entries before they are returned.NeilBrown2008-11-041-0/+1
| | | | | | | | | | | | | | It is possible for the mapfile to become wrong, and that gets very confusing. So validate entries before returning them. Signed-off-by: NeilBrown <neilb@suse.de>
* | mdopen: use small sequence number for uniquifying array names.NeilBrown2008-11-041-1/+2
| | | | | | | | | | | | | | | | | | Rather than appending the md minor number, we now append a small sequence number to make sure name in /dev/md/ that aren't LOCAL are unique. As the map file is locked while we do this, we are sure of no losing any races. Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: allow members of containers to be assembled and auto-assembled.NeilBrown2008-11-041-0/+3
| | | | | | | | | | | | | | | | | | | | Try to treat members of containers much like other arrays for assembly. We still look through the list of devices for a match (it will be the container), then find the relevant 'info' and try to assemble the array. Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: factor out assemble_container_contentDan Williams2008-11-041-0/+3
| | | | | | | | | | | | | | | | | | Factor out, from Incremental_container, the code for assembling an array based on information extracted from a container. We will shortly use this from Assemble too. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: revert preliminary -As supportDan Williams2008-11-041-1/+0
| | | | | | | | | | | | I have seen the light. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Incremental: lock against multiple concurrent additions to an array.NeilBrown2008-11-041-0/+2
| | | | | | | | | | | | | | In two devices are added via -I to one array at the same time, mdadm can get badly confused. Signed-off-by: NeilBrown <neilb@suse.de>
* | Manage: when stopping an array, delete all names from /dev.NeilBrown2008-11-041-0/+1
| | | | | | | | | | | | | | | | | | This only applies if udev isn't installed or is disabled by MDADM_NO_UDEV We try to remove partitions too. We find names to remove by looking in /var/run/mdadm/map Signed-off-by: NeilBrown <neilb@suse.de>
* | Generate 'change' uevents when arrays change in non-obvious ways.NeilBrown2008-11-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | When a 'container' gets started, we need udev to notice, but the kernel has no way of knowing that a KOBJ_CHANGE event is needed. So send one directly via the 'uevent' sysfs attribute. Also, uevents don't get generated when md arrays are stopped (prior to 2.6.28) so send 'change' events then too. Signed-off-by: NeilBrown <neilb@suse.de>
* | config: Support container=uuid as alternative to container=/dev/name in ↵NeilBrown2008-11-041-2/+3
| | | | | | | | | | | | | | | | | | | | mdadm.conf When mdadm.conf is automatically generated, we might not know a suitable /dev/name. But we do know the uuid of the container. So allow that as an option. Signed-off-by: NeilBrown <neilb@suse.de>
* | Incremental: adjust to the new naming scheme.NeilBrown2008-11-041-3/+2
| | | | | | | | | | --incremental now uses exactly the same create_mddev that other code uses.
* | mdopen: Introduce new rules for creating device name.NeilBrown2008-11-041-1/+6
| | | | | | | | MORE CONTENT HERE
* | util: make env checking more genericNeilBrown2008-11-041-1/+1
| | | | | | | | | | | | | | Change the "env_check_mdmon" function to be more generic, accepting and environment variable name, as soon we will have a new use for it. Signed-off-by: NeilBrown <neilb@suse.de>
* | Delay creation of array devices for assemble/build/createNeilBrown2008-11-041-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | We will shortly be feeding more information into the process of creating array devices, so delay the creation. Still open them early if the device already exists. This involves making sure the autof flag is in the right place so that it can be found at creation time. Also, Assemble, Build, and Create now always close 'mdfd'. Signed-off-by: NeilBrown <neilb@suse.de>
* | Introduce new open_mddev which just does an open.NeilBrown2008-11-041-0/+1
| | | | | | | | | | | | | | Some cases we aren't interested in creating the mddev, just opening it. Make those more explicit. Signed-off-by: NeilBrown <neilb@suse.de>
* | Rename open_mddev to create_mddevNeilBrown2008-11-041-2/+2
| | | | | | | | | | | | | | This reflect that fact that more often than not it is creating things in /dev, and allows for a new open_mddev which does just that. Signed-off-by: NeilBrown <neilb@suse.de>
* | Preliminary -As support for container member arraysDan Williams2008-10-281-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Given an mdadm.conf like the following allow /dev/imsm and /dev/md/r1 to be created by "mdadm -As". DEVICES partitions ARRAY /dev/imsm metadata=imsm auto=md UUID=b98f5dbe-aa859e7b-0e369b89-a80986d4 ARRAY /dev/md/r1 container=/dev/imsm member=0 auto=mdp UUID=3538e39c-b397c2e9-1aa031f9-2bc0eca4 spares=1 Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Merge branch 'master' into devel-3.0NeilBrown2008-10-271-1/+1
|\| | | | | | | | | | | | | Conflicts: Create.c Manage.c
| * Allow WRITEMOSTLY to be cleared on --readd using --readwrite.NeilBrown2008-10-251-1/+1
| | | | | | | | | | | | | | | | Previously it was possible to set the WRITEMOSTLY flag when adding a device to an array, but not to clear the flag when re-adding. This is now possible with --readwrite. Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' into devel-3.0NeilBrown2008-10-171-1/+3
|\| | | | | | | | | | | Conflicts: Manage.c
| * Improve reporting of layout for raid10.NeilBrown2008-10-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Showing e.g. near=1, far=2 for the 'far2' layout of raid10 is confusing even though there is a sense in which is it correct. Make it less confusing by only printing whichever number is not 1. If both are 1, make that clear too (i.e. no redundancy).
| * Manage: allow adding device that is just large enough to v1.x array.NeilBrown2008-10-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | When adding a device to an array, we check that it is large enough. Currently the check makes sure there is also room for a reasonably sized bitmap. But if the array doesn't have a bitmap, then this test might be too restrictive. So when adding, only insist there is enough space for the current bitmap. When Creating, still require room for the standard sized bitmap. This resolved Debian Bug 500309
* | quiet WaitClean()Dan Williams2008-10-151-1/+1
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Allow a uuid of all f's to always matchDan Williams2008-10-151-0/+1
| | | | | | | | | | | | | | The uuid returned for an imsm spare device will never match the uuid of an active disk. So make mdadm interpret a uuid of all f's as "match any". Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | sysfs: dprintf when we fail to write a sysfs fileDan Williams2008-10-151-0/+8
| | | | | | | | | | | | | | When arrays do not startup correctly it would be nice to know why. Need to move the dprintf definition to mdadm.h Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Add support for assembling specific subarrays.NeilBrown2008-09-181-0/+6
| | | | | | | | | | This normally isn't needed as --incremental does all the work. But it is needed to recognise member= and container= in mdadm.conf
* | Report uuid in --detail --brief for ddf and intelNeilBrown2008-09-181-1/+1
| | | | | | | | The uuid is slightly fictitious but needed for array matching.
* | Use uuid as /dev name when assembling array of uncertain origin.NeilBrown2008-09-181-0/+2
| | | | | | | | | | If we aren't sure that the array belongs to 'this' host, use the uuid to choose a name to avoid any conflict.
* | Allow metadata handler to report that it doesn't record homehost.NeilBrown2008-09-181-2/+1
| | | | | | | | | | | | | | For now, this means that the lack of a homehost doesn't always prevent assembly. Soon we will allow assembly anyway, but have different messages if homehost isn't supported.
* | Handle incremental assembly of containers.NeilBrown2008-09-181-0/+8
| | | | | | | | | | | | | | | | | | 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-181-2/+3
| | | | | | | | | | | | | | | | | | | | 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>
* | Factor out add-disk codeNeilBrown2008-09-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | The variety of approaches to 'add_disk' are factored out into a separate function, and Incremental mode benefits by being closer to supporting the assembly of containers. Also remove the adding-to-array-data-structure out of sysfs_add_disk and into add_disk. And add some tests for --incremental mode to make sure we don't break it. Signed-off-by: NeilBrown <neilb@suse.de>
* | Teach --detail about containers and members there-of.NeilBrown2008-09-181-0/+1
| | | | | | | | | | | | | | | | | | | | Make --detail on a container more useful by suppressing irrelevant detail and adding useful detail like a list of member arrays. Ditto for members of a container: report the name of the container array. Signed-off-by: NeilBrown <neilb@suse.de>
* | 'mdadm --wait-clean' wait for array to be marked cleanDan Williams2008-09-151-0/+5
| | | | | | | | | | | | | | | | | | For use in distro shutdown scripts with a RAID root file system. Returns immediately if the array is 'readonly', or not an externally managed array. It is up to the distro's scripts to make sure no new writes hit the device after this returns 'true'. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Add ping_monitor() to mdadm --waitDan Williams2008-09-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The action we are waiting for may not be complete until the monitor has had a chance to take action on the result. The following script can now remove the device on the first attempt, versus a few attempts with the original Wait(): #!/bin/bash #export MDADM_NO_MDMON=1 export IMSM_DEVNAME_AS_SERIAL=1 ./mdadm -Ss ./mdadm --zero-superblock /dev/loop[0-3] echo 2 > /proc/sys/dev/raid/speed_limit_max ./mdadm --create /dev/imsm /dev/loop[0-3] -n 4 -e imsm -a md ./mdadm --create /dev/md/r1 /dev/loop[0-3] -n 4 -l 5 --force -a mdp ./mdadm --fail /dev/md/r1 /dev/loop3 ./mdadm --wait /dev/md/r1 x=0 while ! ./mdadm --remove /dev/imsm /dev/loop3 > /dev/null 2>&1 do x=$((x+1)) done echo "removed after $x attempts" ./mdadm --add /dev/imsm /dev/loop3 Include 2 small cleanups: * remove the almost open coded fd2devnum() in Wait() by introducing a new utility routine stat2devnum() * teach connect_monitor() to parse the container device from a subarray string Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Honor safemode_delay at Create() and Incremental() timeDan Williams2008-09-151-0/+1
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>