summaryrefslogtreecommitdiffstats
path: root/config.c
Commit message (Collapse)AuthorAgeFilesLines
* config: add 'homehost' option to 'AUTO' line.NeilBrown2010-03-031-2/+16
| | | | | | 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>
* Fix segfault when the AUTO keyword is used in the config fileDoug Ledford2010-01-191-1/+10
| | | | | Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Update copyright dates and remove references to @cse.unsw.edu.auNeilBrown2009-06-021-7/+2
| | | | | | Also removed 'paper' addresses. Signed-off-by: NeilBrown <neilb@suse.de>
* mapfile - when rebuilding, choose an appropriate name is none is found.NeilBrown2009-05-111-0/+70
| | | | | | | | 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>
* config: enhance name matching in conf_get_ident.NeilBrown2009-05-111-1/+1
| | | | | | | | | | Use when searching mdadm.conf for a device, use more flexible matching that e.g. ignores leading /dev/md/ or /dev/ As mdadm now accepts both "/dev/md/foo" and "foo" is many places as equivalent, they should compare as the same. Signed-off-by: NeilBrown <neilb@suse.de>
* Allow homehost to be largely ignored when assembling arrays.NeilBrown2009-05-111-2/+62
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* config: allow Array line to contain array name without /dev/md/ prefix.NeilBrown2009-05-111-5/+40
| | | | | | | | | | | | | | | 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-111-1/+1
| | | | | | | | 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>
* conf/assemble: new config line "auto".NeilBrown2009-05-111-2/+63
| | | | | | | | | | | | | | | | | | | 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/+1
| | | | | | | | | | | | | | 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>
* config: treat "container=" and "member=" and providing the required identity ↵NeilBrown2009-04-061-1/+3
| | | | | | information. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'master' into scratch-3.0NeilBrown2009-01-081-1/+1
|\ | | | | | | | | | | | | Conflicts: Assemble.c config.c
| * Fail overtly when asprintf fails to allocate memoryDustin Kirkland2009-01-081-1/+1
| | | | | | | | | | | | .. rather that causing a less-obvious violation of segments. 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>
* | 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-041-3/+43
| | | | | | | | | | | | | | 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>
* | config: Support container=uuid as alternative to container=/dev/name in ↵NeilBrown2008-11-041-1/+2
| | | | | | | | | | | | | | | | | | | | 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-5/+4
| | | | | | | | | | | | | | | | | | | | 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'.
* | Preliminary -As support for container member arraysDan Williams2008-10-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | trivial warn_unused_result squashingDan Williams2008-10-151-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Made the mistake of recompiling the F9 mdadm rpm which has a patch to remove -Werror and add "-Wp,-D_FORTIFY_SOURCE -O2" which turns on lots of errors: config.c:568: warning: ignoring return value of asprintf Assemble.c:411: warning: ignoring return value of asprintf Assemble.c:413: warning: ignoring return value of asprintf super0.c:549: warning: ignoring return value of posix_memalign super0.c:742: warning: ignoring return value of posix_memalign super0.c:812: warning: ignoring return value of posix_memalign super1.c:692: warning: ignoring return value of posix_memalign super1.c:1039: warning: ignoring return value of posix_memalign super1.c:1155: warning: ignoring return value of posix_memalign super-ddf.c:508: warning: ignoring return value of posix_memalign super-ddf.c:645: warning: ignoring return value of posix_memalign super-ddf.c:696: warning: ignoring return value of posix_memalign super-ddf.c:715: warning: ignoring return value of posix_memalign super-ddf.c:1476: warning: ignoring return value of posix_memalign super-ddf.c:1603: warning: ignoring return value of posix_memalign super-ddf.c:1614: warning: ignoring return value of posix_memalign super-ddf.c:1842: warning: ignoring return value of posix_memalign super-ddf.c:2013: warning: ignoring return value of posix_memalign super-ddf.c:2140: warning: ignoring return value of write super-ddf.c:2143: warning: ignoring return value of write super-ddf.c:2147: warning: ignoring return value of write super-ddf.c:2150: warning: ignoring return value of write super-ddf.c:2162: warning: ignoring return value of write super-ddf.c:2169: warning: ignoring return value of write super-ddf.c:2172: warning: ignoring return value of write super-ddf.c:2176: warning: ignoring return value of write super-ddf.c:2181: warning: ignoring return value of write super-ddf.c:2686: warning: ignoring return value of posix_memalign super-ddf.c:2690: warning: ignoring return value of write super-ddf.c:3070: warning: ignoring return value of posix_memalign super-ddf.c:3254: warning: ignoring return value of posix_memalign bitmap.c:128: warning: ignoring return value of posix_memalign mdmon.c:94: warning: ignoring return value of write mdmon.c:221: warning: ignoring return value of pipe mdmon.c:327: warning: ignoring return value of write mdmon.c:330: warning: ignoring return value of chdir mdmon.c:335: warning: ignoring return value of dup monitor.c:415: warning: rv may be used uninitialized in this function ...some of these like the write() ones are not so trivial so save those fixes for the next patch. 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
* Fix for segfault when reading /proc/mdstatNeil Brown2008-04-281-0/+13
| | | | | | | | | Some kernel versions don't put a space between 'active' and '(auto-read-only)' in /proc/mdstat. This causes a parsing problem leaving 'level' set to NULL which causes a crash. So synthesise a space there if it is missing, and check for 'level' to be NULL and don't de-ref if it is.
* Remove spaces/tabs from ends of lines.Neil Brown2007-12-141-7/+7
|
* config.c include dirent.h instead sys/dir.hmaximilian attems2007-09-241-1/+1
| | | | | | | | | | sys/dir.h is an old BSD'ism, include dirent directly. small step for better klibc support. compile tested against glibc. Signed-off-by: maximilian attems <max@stro.at> Signed-off-by: Neil Brown <neilb@suse.de>
* Add new mode: --incrementalNeil Brown2006-12-211-1/+17
| | | | | --incremental allows arrays to be assembled one device at a time. This is expected to be used with udev.
* Default to --auto=yesNeil Brown2006-12-141-0/+1
| | | | | so the array devices with 'standard' names get created automatically, as this is almost always what is wanted.
* Strdup the bitmap file name found in the config fileNeil Brown2006-11-091-1/+1
| | | | Otherwise we quickly lose it...
* Allow a number after --auto=yesNeil Brown2006-10-131-0/+2
| | | | | | So if the device name is /dev/md/d0, then the number of partitions is as given. This is useful in 'CREATE' in mdadm.conf
* Allow symlink creation to be disabled from command line or mdadm.confNeil Brown2006-08-111-2/+6
|
* More consistent honoring of --configfileNeil Brown2006-06-261-15/+21
| | | | | Never use /etc/mdadm.conf if --config file is given (previously some code used one, some used the other).
* Stop map_dev from returning [0:0]Neil Brown2006-06-201-1/+2
| | | | | We sometimes need the NULL when major==minor==0. So make sure all callers of map_dev can cope with NULL.
* Allow default metadata to be specified in mdadm.confNeil Brown2006-06-021-0/+10
| | | | | | | CREATE metadata=1 in mdadm.conf will cause version-1 superblocks to be the default. Signed-off-by: Neil Brown <neilb@suse.de>
* Improve compiling for static binaries.Neil Brown2006-05-291-4/+0
| | | | | | | | | Have "#ifdef STATIC" in config.c, and the 'rmconf' target was a mess. Instead, create 'pwgr.c' with stub routines for those unavailable when statically compiled, and include that in STATICOBJ Signed-off-by: Neil Brown <neilb@suse.de>
* Initial implementation of auto-assemblyNeil Brown2006-05-261-0/+2
| | | | | | This basically works, but needs various improvements and some tests. Signed-off-by: Neil Brown <neilb@suse.de>
* Allow homehost to be set on command line or in config fileNeil Brown2006-05-191-0/+23
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Improve code for recognising config lines.Neil Brown2006-05-191-12/+19
| | | | | | No more magic numbers. Signed-off-by: Neil Brown <neilb@suse.de>
* Just updaqte copyright dates and email addressNeil Brown2006-05-191-1/+1
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Arrange the 'auto' setting in mdadm.conf can choose default type.Neil Brown2006-05-161-12/+17
| | | | | | | | | | | | So when you say auto=md or auto=part in mdadm.conf, it give a preference for type of array, but standard name will override. But --auto=md is more insistant. FIXME I'm not at all happy about handling of names that already exist. I don't think that should be removed if the device is active. Signed-off-by: Neil Brown <neilb@suse.de>
* Allow default creation info to to be stored in mdadm.confNeil Brown2006-05-151-27/+121
| | | | | | Default owner, group, mode and 'auto' flag can be given in a 'CREATE' line. Signed-off-by: Neil Brown <neilb@suse.de>
* Assume "DEVICE partitions" if no DEVICE line present.Neil Brown2006-05-151-1/+5
| | | | | | | This means the output of "mdadm -Es" can be used as a complete mdadm.conf file .... if you really want to do that. Signed-off-by: Neil Brown <neilb@suse.de>
* Support 'mailfrom' line in mdadm.conf so the From: line in alert emails can ↵Neil Brown2006-05-151-1/+27
| | | | | | be explicitly set. Signed-off-by: Neil Brown <neilb@suse.de>
* Use O_DIRECT to read bitmap files.Neil Brown2006-05-151-1/+1
| | | | | | | | A pending patch to the kernel causes bitmap file updates to not go through the page cache, so O_DIRECT is needed to ensure that we read current data. Signed-off-by: Neil Brown <neilb@suse.de>
* Support 'bitmap=' in mdadm.conf for auto-assembling arrays with write-intent ↵Neil Brown2006-03-291-0/+8
| | | | | | bitmaps in separate files. Signed-off-by: Neil Brown <neilb@suse.de>
* Create missing /dev files where needed.Neil Brown2006-03-281-5/+1
| | | | | | | Whenever we need a device file to open, if one cannot be found in /dev, create a temporary one. Signed-off-by: Neil Brown <neilb@suse.de>
* Allow /etc/mdadm/mdadm.conf as an alternate to /etc/mdadm.confNeil Brown2005-12-091-1/+17
| | | | | | This provide compatability with Debian. Signed-off-by: Neil Brown <neilb@suse.de>
* Allow scanning of devices listed in /proc/partitions independant of /devNeil Brown2005-12-051-7/+10
| | | | | | | If a device found in /proc/partitions isn't listed in /dev, then mknod a temporary name and open that. Signed-off-by: Neil Brown <neilb@suse.de>
* Support nameing of version-1 arrays.Neil Brown2005-08-091-1/+11
| | | | | | | --name is recognised in --create and --assemble name= is recognised in config file. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Assorted Fixes for multiple bugs.Neil Brown2005-08-041-1/+3
| | | | | | | Assemble would crash, or just not work. A few other problem found by a new test-suite. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Allow --auto to still be meaningful when --scan is givenNeil Brown2005-06-141-1/+1
| | | | Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
* Initialise mis.next to NULLNeil Brown2005-06-141-0/+1
| | | | | | Probably not needed, but safer. Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>