summaryrefslogtreecommitdiffstats
path: root/Incremental.c
Commit message (Collapse)AuthorAgeFilesLines
* Make Incremental container assembly behave like native array assemblyDoug Ledford2010-04-131-11/+23
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* Initial implementation of incremental remove supportDoug Ledford2010-04-131-0/+36
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* config: add 'homehost' option to 'AUTO' line.NeilBrown2010-03-031-13/+17
| | | | | | This allows basing auto-assembly decisions on whether the array is recorded as belonging to this host or not. Signed-off-by: NeilBrown <neilb@suse.de>
* Update copyright dates and remove references to @cse.unsw.edu.auNeilBrown2009-06-021-1/+1
| | | | | | Also removed 'paper' addresses. Signed-off-by: NeilBrown <neilb@suse.de>
* Incr: use devname_matches to when looking in mdadm.conf for bitmap fileNeilBrown2009-05-111-1/+1
| | | | | | This is more likely to always do the right thing than a strcmp. Signed-off-by: NeilBrown <neilb@suse.de>
* Incremental: fix uninitialised variable.NeilBrown2009-05-111-2/+2
| | | | | | | st2 might not be initialised at this point. So use the more correct 'st'. Signed-off-by: NeilBrown <neilb@suse.de>
* Incr: cope better with possibility that mp->path might be NULLNeilBrown2009-05-111-17/+17
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Be more consistent about keeping the host: prefix on array names.NeilBrown2009-05-111-5/+7
| | | | | | | | | | | | If an array name contains a "hostname:" prefix, then --assemble will tend to leave it there, while --incremental will strip it off (when chosing a device name during auto-assembly). Make this more consistent: strip the name off if we decide that the name will be treated as 'local'. Leave it on if it will be treated as 'foreign'. Signed-off-by: NeilBrown <neilb@suse.de>
* Allow homehost to be largely ignored when assembling arrays.NeilBrown2009-05-111-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* Assemble/Incr : minor tidy up of setting 'trustworthy'.NeilBrown2009-05-111-0/+2
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* conf/assemble: new config line "auto".NeilBrown2009-05-111-0/+9
| | | | | | | | | | | | | | | | | | | 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-111-1/+19
| | | | | | | | | | | | | | 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-111-2/+3
| | | | | | | | | | | | | 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>
* 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>
* 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>
* wait_for improvement.NeilBrown2009-04-071-3/+3
| | | | | | | | 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>
* Incremental/container: don't create when we should just be opening.NeilBrown2009-03-101-7/+10
| | | | | | | When incr-assembling in a container, if the array already exists, don't try to create it again, just open it. Signed-off-by: NeilBrown <neilb@suse.de>
* Incremental: fix some handling of trustworthy.NeilBrown2009-03-101-12/+14
| | | | | | | | | | | 1/ if homehost matches, then we need to set trustworthy to 'LOCAL' 2/ if we decide to set trustworthy to 'METADATA' because we have to use the metadata version name, do that *after* we have checked if we are going to assemble within a container, as inside the container there could be different sources of names to use. Signed-off-by: NeilBrown <neilb@suse.de>
* Incremental: honor --no-degraded to delay assemblyDan Williams2009-02-241-1/+4
| | | | | | | | | | Currently Incremental_container is being called after adding each disk. In the imsm case where spares are not tracked in the raid_disks field we can use --no-degraded to block premature assembly. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Incremental: fix 'name_to_use' in the container caseDan Williams2009-02-241-2/+9
| | | | | | | | | Just like the Assemble case, default to the text_version of the container if another name is not specified. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Merge branch 'master' into devel-3.0NeilBrown2008-12-181-53/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Assemble.c Incremental.c Kill.c ReadMe.c inventory mapfile.c mdadm.8 mdadm.spec mdassemble.8
| * map: rebuild map if it doesn't exist.NeilBrown2008-12-181-47/+0
| | | | | | | | | | | | | | | | | | It is possible for some arrays to be created e.g. by initrd, and so not get mentioned in /var/run/mdadm/map. As "-I" depends on things being listed in 'map', we create it by scanning all devices if it doesn't exist. Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: close mdfd before returning from assemble_container_contentNeilBrown2008-11-071-1/+0
| | | | | | | | | | | | This makes sure it is consistently closed. Signed-off-by: NeilBrown <neilb@suse.de>
* | Wait for name to appear after create/assemble etc.NeilBrown2008-11-041-0/+2
| | | | | | | | | | | | | | 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>
* | 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>
* | Assemble: factor out assemble_container_contentDan Williams2008-11-041-56/+5
| | | | | | | | | | | | | | | | | | 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>
* | Quiet unitialized variable warningsDan Williams2008-11-041-4/+3
| | | | | | | | | | 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-041-10/+18
| | | | | | | | | | | | | | 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>
* | Generate 'change' uevents when arrays change in non-obvious ways.NeilBrown2008-11-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | 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-5/+27
| | | | | | | | | | | | | | | | | | | | 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>
* | config: Don't require an array to have a device name.NeilBrown2008-11-041-9/+15
| | | | | | | | | | | | | | | | | | | | i.e. in mdadm.conf you can have a line like ARRAY uuid=whatever and it will use auto-name-generation to give a name to the array at assemble-time. The is different from blind auto-assembly in that the array will be treated as 'local'.
* | Incremental: adjust to the new naming scheme.NeilBrown2008-11-041-180/+50
| | | | | | | | | | --incremental now uses exactly the same create_mddev that other code uses.
* | Rename open_mddev to create_mddevNeilBrown2008-11-041-3/+3
| | | | | | | | | | | | | | 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>
* | cleanup an unused call to container2devnameDan Williams2008-11-041-19/+0
| | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' into scratch-3.0NeilBrown2008-11-031-2/+3
|\|
| * Incremental: change precedence order for autof setting.NeilBrown2008-11-031-3/+4
| | | | | | | | | | | | | | | | | | It doesn't really make sense for the --auto setting to ever over-ride the setting on an ARRAY line. That could cause failure if the ARRAY line has a 'standard' now. So revert to the array line having precedence over command line, then CREATE line last. Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' into devel-3.0NeilBrown2008-10-301-13/+30
|\| | | | | | | | | | | | | | | Conflicts: Incremental.c super0.c super1.c
| * Incremental: allow assembly of foreign array.NeilBrown2008-10-301-6/+12
| | | | | | | | | | | | | | | | | | | | | | If a foreign (i.e. not known to be local) array is discovered by --incremental assembly, we now assemble it. However we ignore any name information in the array so as not to potentially create a name that conflict with a 'local' array. Also, foreign arrays are always assembled 'read-auto' to avoid writing anything until the array is actually used. Signed-off-by: NeilBrown <neilb@suse.de>
| * Incremental: fix setting of 'autof' flag.NeilBrown2008-10-301-4/+10
| | | | | | | | | | | | | | When doing auto-assembly, the 'autof' flag from array lines in mdadm.conf was being ignored. Signed-off-by: NeilBrown <neilb@suse.de>
| * Fix --incremental assembly of partitions arrays.NeilBrown2008-10-301-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If incremental assembly finds an array mentioned in mdadm.conf, with a 'standard partitioned' name like /dev/md_d0 or /dev/md/d0, it will not create a partitioned array like it should. This is because it mishandled the 'devnum' returned by is_standard. That is a devnum that does not have the partition-or-not encoded into it. So we need to check the actual return value of is_standard and encode the partition-or-not info into the devnum. Also fix a couple of comments. Signed-off-by: NeilBrown <neilb@suse.de>
| * Fix NULL pointer oopsDoug Ledford2008-10-301-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | RAID10 is the only raid level that uses the avail char array pointer during the enough() operation, so it was the only one that saw this. The code in incremental assumes unconditionally that count_active will allocate the avail char array, that it might be used by enough, and that it will need to be freed afterward. Once you make count_active actually do that, then the oops goes away. Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Preliminary -As support for container member arraysDan Williams2008-10-281-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Don't try to set_array_info when -I find new devices for an array.NeilBrown2008-09-181-2/+10
| | | | | | | | | | | | | | | | | | | | | | When -I get a new device for a container and tries to incrementally assemble the container array, it calls sysfs_set_array to create the array without first checking if it already exists. This produces unpleasant error messages. So check first. Signed-off-by: NeilBrown <neilb@suse.de>
* | Add support for assembling specific subarrays.NeilBrown2008-09-181-3/+46
| | | | | | | | | | 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-2/+2
| | | | | | | | The uuid is slightly fictitious but needed for array matching.
* | Use uuid as /dev name when assembling array of uncertain origin.NeilBrown2008-09-181-18/+38
| | | | | | | | | | 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-1/+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.
* | Lots of fixes to make incremental assembly of containers work.NeilBrown2008-09-181-56/+93
| | | | | | | | | | | | | | | | So: mdadm -I /dev/whatever will (if appropriate) add whatever to a container, then start any arrays inside the container.
* | Handle incremental assembly of containers.NeilBrown2008-09-181-2/+11
| | | | | | | | | | | | | | | | | | 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-26/+16
| | | | | | | | | | | | | | | | | | | | 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>