summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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.
* | Don't give array name in --examine --brief output if it is doubtful.NeilBrown2008-11-043-7/+10
| | | | | | | | | | Now that mdadm.conf doesn't need an array name, we don't need to give one if the array cannot reliably provide one.
* | config: Support container=uuid as alternative to container=/dev/name in ↵NeilBrown2008-11-043-8/+32
| | | | | | | | | | | | | | | | | | | | 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-044-25/+23
| | | | | | | | | | | | | | | | | | | | 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-044-264/+54
| | | | | | | | | | --incremental now uses exactly the same create_mddev that other code uses.
* | mdopen: Restore creation of partition devices and symlink.NeilBrown2008-11-041-33/+36
| | | | | | | | | | Using the 'new' name scheme we restore the creation of partition links (in the case the udev isn't used).
* | mdopen: Introduce new rules for creating device name.NeilBrown2008-11-046-185/+242
| | | | | | | | MORE CONTENT HERE
* | util: make env checking more genericNeilBrown2008-11-044-17/+6
| | | | | | | | | | | | | | 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>
* | assemble: combine the two create_mddev calls in to one.NeilBrown2008-11-041-71/+56
| | | | | | | | | | | | This delays the create_mddev call even further in the case where an array device name is given for --assemble. It is now delayed until the 'name' of the array is also available.
* | intel: Avoid 'may be used before initialised' warning.NeilBrown2008-11-041-1/+2
| | | | | | | | | | When compile with -Os, the compile doesn't work out that the variable is always initialised before usage, so we tell it.
* | Delay creation of array devices for assemble/build/createNeilBrown2008-11-046-129/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Avoid opening md device twice in particular '--assemble' instance.NeilBrown2008-11-041-8/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | When mdadm --assemble /dev/whatever is given, mdadm will treat it as though '--scan' were given, even though it wasn't. In this case, the code opens /dev/whatever twice, which is pointless. We already know /dev/whatever is open at this point, so remove the 'open' and the tests, and make sure it is always closed afterwards. Signed-off-by: NeilBrown <neilb@suse.de>
* | Introduce new open_mddev which just does an open.NeilBrown2008-11-043-12/+29
| | | | | | | | | | | | | | 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-046-17/+17
| | | | | | | | | | | | | | 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>
* | Initialise ->container and ->member properly.NeilBrown2008-11-041-0/+2
| | | | | | | | | | | | | | Now that we are using these values, we need to initialise them properly. Signed-off-by: NeilBrown <neilb@suse.de>
* | Move recently merged /sys/dev/ lookup into stat2devnum.NeilBrown2008-11-042-41/+34
| | | | | | | | | | | | | | | | But sysfs_init and stat2devnum try to convert stat information into an md devnum. Combine all the value of both pieces of code into stat2devnum and have sysfs_init call 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-1/+1
|\|
| * mapfile: fix bug in testing for /var/run/mdadm/NeilBrown2008-11-031-1/+1
| | | | | | | | | | | | | | | | There was a bug. If /var/run/mdadm/ did not exist as a directory, the map file should have been created in /var/run/mdadm.map, but due to bug it would never get created. 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-302-4/+27
|\|
| * Adjust major number testing to allow for extended minor number in 2.6.28NeilBrown2008-10-302-4/+27
| | | | | | | | | | | | | | | | | | | | | | | | From 2.6.28, normal md device will be able to have partitions. These partitions will have a different major number. Sometimes mdadm tests the major number and so can get confused. Change these tests to test against get_mdp_major(). mdp does not use extended minor number and so this test will always be accurate. Also use /sys/dev links to map major/minor to devnum in sysfs. Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' into devel-3.0NeilBrown2008-10-305-19/+36
|\| | | | | | | | | | | | | | | Conflicts: Incremental.c super0.c super1.c
| * Incremental: allow assembly of foreign array.NeilBrown2008-10-302-7/+13
| | | | | | | | | | | | | | | | | | | | | | 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-302-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * Fix bad metadata formattingDoug Ledford2008-10-303-4/+10
| | | | | | | | | | | | | | | | | | | | | | Certain operations (Detail.c mainly) would print out the metadata of an array in a format that the scan operation in super0.c and super1.c would later reject as unknown when it was found in the mdadm.conf file. Use a consistent format, but also modify the super0 and super1 match methods to accept the other format without complaint. Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Preliminary -As support for container member arraysDan Williams2008-10-286-9/+64
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | imsm: include members in ->brief_examineDan Williams2008-10-281-1/+15
| | | | | | | | A prerquisite for getting imsm arrays assembled by mdadm -As.
* | imsm: copy raid device info when associating sparesDan Williams2008-10-281-0/+18
| | | | | | | | | | | | | | If a spare is included in the list of examined disks we need to copy in at least enough information to get the uuid of the populated container. Signed-off-by: Dan Williams <dan.j.williams@intel.com>