summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | imsm: cleanup ->match_home and comment on return valueDan Williams2008-11-071-1/+8
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Create: don't wait for device to appear if we didn't actually start the arrayNeilBrown2008-11-071-1/+1
| | | | | | | | | | | | | | Otherwise we get an unpleasant 2 second pause when array creation fails. Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: close mdfd before returning from assemble_container_contentNeilBrown2008-11-072-4/+8
| | | | | | | | | | | | This makes sure it is consistently closed. Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: return correct status from assemble_container_content.NeilBrown2008-11-071-4/+5
| | | | | | | | | | | | Otherwise autoassembly can get confused. Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: fix some auto-assemble bugs.NeilBrown2008-11-071-5/+8
| | | | | | | | | | | | | | 1/ when we choose not to use a device, must set ->used to 2, not 1. 2/ When we give up on a member, clear st and content. Signed-off-by: NeilBrown <neilb@suse.de>
* | mdopen: typo in buffer-length for a sprintf.NeilBrown2008-11-071-1/+1
| | | | | | | | | | | | | | That '10000' should have been '1000'. Make it a 'sizeof' to avoid such carelessness. Signed-off-by: NeilBrown <neilb@suse.de>
* | Makefile: install udev file into $DESTDIRNeilBrown2008-11-071-1/+1
| | | | | | | | | | | | Forgot the $DESTDIR in the install target :-( Signed-off-by: NeilBrown <neilb@suse.de>
* | A couple of bugfixes found by suse autobuilding:NeilBrown2008-11-072-3/+17
| | | | | | | | | | | | | | 1/ ia64 appear to have __clone2, not clone. 2/ Including "++" in the arg to a macro is a bad thing to do. Signed-off-by: NeilBrown <neilb@suse.de>
* | Release 3.0-devel2NeilBrown2008-11-056-4/+104
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
* | Man pages: updates for container etc.NeilBrown2008-11-052-64/+197
| | | | | | | | | | | | Multiple updates to try to get up to date with current code. Signed-off-by: NeilBrown <neilb@suse.de>
* | Stop: drop any partitions that may be associated with an array when stopping it.NeilBrown2008-11-041-1/+4
| | | | | | | | | | | | | | Not all kernels automatically discard partitions when the array is stopped, so call the RRPART ioctl to force it. Signed-off-by: NeilBrown <neilb@suse.de>
* | Wait for name to appear after create/assemble etc.NeilBrown2008-11-046-3/+23
| | | | | | | | | | | | | | 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-042-10/+30
| | | | | | | | | | | | | | 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>
* | tests/06name: adjust for homehostNeilBrown2008-11-041-2/+2
| | | | | | | | | | | | | | Now that we set homehost by default, adjust teh 06name test accordingly. Signed-off-by: NeilBrown <neilb@suse.de>
* | test: always start with a clean slate.NeilBrown2008-11-041-0/+2
| | | | | | | | | | | | | | To avoid confusion with old array, also zero superblocks before starting a test. Signed-off-by: NeilBrown <neilb@suse.de>
* | Incrmental: cope with udev slowness and errors in map file.NeilBrown2008-11-041-3/+10
| | | | | | | | | | | | | | | | | | | | If udev hasn't created the array yet, we might still want to open it. So open directly by major:minor. Also, of array in map file doesn't appear to exist, do use the name associated with it. Signed-off-by: NeilBrown <neilb@suse.de>
* | Abort sysfs_read early if no device found.NeilBrown2008-11-041-0/+5
| | | | | | | | | | | | | | sysfs_read currently tried to look in sysfs even in no valid sys_name was found. Don't to that. Signed-off-by: NeilBrown <neilb@suse.de>
* | mdopen: only let numeric name set minor number if it doesn't cause a conflict.NeilBrown2008-11-041-1/+4
| | | | | | | | | | | | | | So if the array with minor number matching the name of a new array already exists, just assemble with a different minor number. Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: we were missing a 'close'NeilBrown2008-11-041-0/+1
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
* | test: make sure udev isn't opening a device before closing it.NeilBrown2008-11-041-0/+3
| | | | | | | | | | | | | | As we open and close so quickly, udev might still have the device open. so call udevsettle before stopping an array during testing. Signed-off-by: NeilBrown <neilb@suse.de>
* | Man page update for containers etc.NeilBrown2008-11-041-1/+15
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: store homehost information to allow smooth assembly.NeilBrown2008-11-041-0/+2
| | | | | | | | | | | | | | When we create our own ddf array, store the homehost in the vendor information so it can be so to ensure 'LOCAL' name choices. Signed-off-by: NeilBrown <neilb@suse.de>
* | Create: make sure chosen_name is used for array name generation in CreateNeilBrown2008-11-041-0/+1
| | | | | | | | | | | | | | As with Assemble, one create_mddev has chosen a name, we should always use that rather than the passed 'mddev'. Signed-off-by: NeilBrown <neilb@suse.de>
* | Create: Don't optimise resync as recovery when creating raid5 in a container.NeilBrown2008-11-041-1/+2
| | | | | | | | | | | | | | | | As spares are treated quite differently in containers, we cannot fake-up a spare to optimise initialisation for a raid5 in a container, so disable that code for ->external arrays. Signed-off-by: NeilBrown <neilb@suse.de>
* | mdopen: use small sequence number for uniquifying array names.NeilBrown2008-11-044-10/+44
| | | | | | | | | | | | | | | | | | 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: revise detection of 'autoassemble' mode.NeilBrown2008-11-041-1/+3
| | | | | | | | | | | | | | | | We probably should pass a flag down saying 'this is auto-assembly', but for now, if there is no identity information set, it must be auto-assemble. Signed-off-by: NeilBrown <neilb@suse.de>
* | DDF: report member arrays in examine_brief.NeilBrown2008-11-042-11/+27
| | | | | | | | | | | | Thus an auto-generated config file will list all the arrays. Signed-off-by: NeilBrown <neilb@suse.de>
* | DDF: fix irregularities with retrieval of 'name' from metadata.NeilBrown2008-11-041-3/+12
| | | | | | | | | | | | It is only 16 bytes, not 32. And is space padded, not nul terminated. Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: allow members of containers to be assembled and auto-assembled.NeilBrown2008-11-045-1/+113
| | | | | | | | | | | | | | | | | | | | 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: simplify test for reporting mismatches.NeilBrown2008-11-041-11/+13
| | | | | | | | | | | | | | Rather than open-coding a test of 'verbose' and 'inargv' in multiple places, do it one and set a variable. Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: block attempts to reassemble container membersDan Williams2008-11-041-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | Attempting to open(O_EXCL) each candidate device usually filters out all busy raid components. However, containers do not behave like components and will return container_content that may describe active member arrays. This patch just adds a function that will be used to check if a container member is busy. It will be used shortly. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: factor out assemble_container_contentDan Williams2008-11-043-56/+76
| | | | | | | | | | | | | | | | | | 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-044-56/+9
| | | | | | | | | | | | I have seen the light. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Assemble: replace 'info' with 'content'Dan Williams2008-11-041-80/+82
| | | | | | | | | | | | | | | | In preparation for handling the container case where we may need to handle a list of potential member arrays. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | config: add containers to the default search listDan Williams2008-11-041-2/+4
| | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | config: add 'containers' as a DEVICE keywordDan Williams2008-11-042-5/+45
| | | | | | | | | | | | | | Add anything that looks like a container in /proc/mdstat to the devlist Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | imsm: display container uuid in detail_superDan Williams2008-11-041-1/+6
| | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | imsm: display member array uuid in examine_super_imsmDan Williams2008-11-041-9/+16
| | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Quiet unitialized variable warningsDan Williams2008-11-043-7/+7
| | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Incremental: lock against multiple concurrent additions to an array.NeilBrown2008-11-045-13/+68
| | | | | | | | | | | | | | 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>
* | Detail: support MD_DEVNAME in --export for metadata-less devices.NeilBrown2008-11-041-0/+6
| | | | | | | | | | | | | | If there is no metadata (--build was used) then we need to lookup by devnum, not by uuid, to get the map entry. Signed-off-by: NeilBrown <neilb@suse.de>
* | Manage: when stopping an array, delete all names from /dev.NeilBrown2008-11-043-6/+71
| | | | | | | | | | | | | | | | | | 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>
* | assemble: fix setting of 'foreign' trustability.NeilBrown2008-11-041-0/+7
| |
* | mdopen: fix up name parsing.NeilBrown2008-11-041-9/+24
| | | | | | | | I think this is closer to what I want. Fewer surprises anyway.
* | Assemble: Fix naming of container devices.NeilBrown2008-11-041-5/+6
| | | | | | | | | | | | | | | | Container devices are meant to be named for the metadata type. That wasn't happening properly for DDF. Signed-off-by: NeilBrown <neilb@suse.de>
* | Generate 'change' uevents when arrays change in non-obvious ways.NeilBrown2008-11-047-6/+42
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Add udev rules file for mdadm.NeilBrown2008-11-043-1/+36
| | | | | | | | This is based on the rules from openSUSE 11.1-rc3.
* | detail: --export also provided MD_DEVNAMENeilBrown2008-11-041-0/+5
| | | | | | | | | | | | | | | | | | | | MD_NAME is the name of the array extracted directly from the metadata. MD_DEVNAME is the current working name of the array. It should appear in /dev/md. It is possibly what the user gave when creating the array. We extract it from /var/run/mdadm/map. Signed-off-by: NeilBrown <neilb@suse.de>
* | Always update mdadm/map when starting an array.NeilBrown2008-11-045-4/+29
| | | | | | | | | | | | | | | | We previously only updated /var/run/mdadm/map when starting an array with --incremental. However we now make more use of that file (to pass the dev name to udev) so always update it. Signed-off-by: NeilBrown <neilb@suse.de>
* | Always set 'homehost' if not specified.NeilBrown2008-11-041-1/+1
| | | | | | | | | | The default for 'homehost' is now '<system>' rather than unspecified.