summaryrefslogtreecommitdiff
path: root/Assemble.c
Commit message (Collapse)AuthorAge
* mdopen: Introduce new rules for creating device name.NeilBrown2008-11-04
| | | | MORE CONTENT HERE
* assemble: combine the two create_mddev calls in to one.NeilBrown2008-11-04
| | | | | | 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.
* Delay creation of array devices for assemble/build/createNeilBrown2008-11-04
| | | | | | | | | | | | | 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>
* Rename open_mddev to create_mddevNeilBrown2008-11-04
| | | | | | | 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-28
| | | | | | | | | | | | 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>
* Treat all devices at the container level as sparesDan Williams2008-10-15
| | | | | | | | | Raid disk and disk number information is not relevant at the container level, especially for imsm. So arrange for getinfo_super_imsm() to always publish devices as spares and report the number of spares at Assemble() time. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* trivial warn_unused_result squashingDan Williams2008-10-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Report uuid in --detail --brief for ddf and intelNeilBrown2008-09-18
| | | | The uuid is slightly fictitious but needed for array matching.
* Use uuid as /dev name when assembling array of uncertain origin.NeilBrown2008-09-18
| | | | | 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-18
| | | | | | | 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.
* Move calls to SET_ARRAY_INFO to common helper.NeilBrown2008-09-18
| | | | | | | | | | 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-18
| | | | | | | | | | | | | 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>
* Compile fixes, particularly moving more stuff under MDASSEMBLENeilBrown2008-09-18
| | | | Now 'make everything' works again.
* Remove getinfo_super_n and do some other cleaning up.Neil Brown2008-07-12
| | | | | Getting close to a sensible description of what some of the superswitch methods are supposed to do!
* Remove 'major' from superswitch.Neil Brown2008-07-12
| | | | It isn't generally meaningful.
* Merge branch 'master' into devel-3.0Neil Brown2008-06-19
|\ | | | | | | | | | | Conflicts: Makefile
| * Fix bug in forced assemble.Chris Webb2008-06-19
| | | | | | | | | | | | | | From: Chris Webb <chris@arachsys.com> We are loading into the already-loaded 'st' instead of the newly create 'tst', which is clearly wrong.
| * Avoid NULL reference calling free_super and elsewhere.Neil Brown2008-05-27
| | | | | | | | | | | | | | Since we made free_super a superswitch call, we need to be careful that st is non NULL before calling st->ss->free_super(st). Also when updating byteorder there is a chance of a similar NULL deref.
| * Remove stray semicolonNeil Brown2008-05-27
| | | | | | | | Causes compile error with gcc-2.95
| * Fix autoassemble for stack arrays.Neil Brown2008-05-20
| | | | | | | | | | | | | | | | If you have stacked arrays, then mdadm -As --homehost=fred should work but doesn't. It gets into an infinite loop! So write some tests, and fix the bugs.
* | Remove st->text_version in favour of info->text_versionNeil Brown2008-05-27
| | | | | | | | | | | | | | I want the metadata handler to have more control over the 'version', particularly for arrays which are members of containers. So discard st->text_version and instead use info->text_version which getinfo_super can initialise.
* | Remove 'fd' arg from sysfs_add_diskNeil Brown2008-05-27
| | | | | | | | | | It it never used, and removing means there are several 'open's that can go.
* | Remove stray semicolonNeil Brown2008-05-27
| | | | | | | | Causes compile error with gcc-2.95
* | Can now mostly assemble DDF arraysNeil Brown2008-05-15
| |
* | Start on --assemble support for DDFNeil Brown2008-05-15
|/
* Avoid possible null dereference in Assemble.Neil Brown2008-05-15
| | | | | If the first device we look at has no superblock, there is no 'st' to free, so don't free it.
* Some tidy up of 'devices' in assemble.Neil Brown2007-12-14
| | | | | use "mdinfo" in the devices list rather than just copying ad-hoc fields in.
* Don't record oldmajor/oldminor any more during assemble.Neil Brown2007-12-14
| | | | We don't use the information at all (any longer).
* Drop the superblock arg from all metadata methods.Neil Brown2007-12-14
| | | | It is now in the 'supertype'
* Fix compare_super to take supertype instead of a superblock.Neil Brown2007-12-14
| | | | | As this function takes 2 superblocks, the change is a bit more subtle, so is done separately.
* Add 'supertype' arg to almost all metadata methods.Neil Brown2007-12-14
| | | | The 'superblock' will be moved into this structure soon.
* Allow metadata handlers to free their own superblock.Neil Brown2007-12-14
| | | | | | As the metadata handler allocates the superblock, it should free it too. DDF will have a more complex 'superblock' which needs more complex freeing.
* Remove spaces/tabs from ends of lines.Neil Brown2007-12-14
|
* Fix bug where v1 superblock might appear active when they should be clean.Neil Brown2006-12-14
| | | | Only happens on kernel with 32 bit sector_t.
* Central calls to ioctl BLKGETSIZENeil Brown2006-12-14
| | | | Instead of opencoding the same thing everywhere.
* Change handling for "--assemble --force" when two drives disappeared at once.Neil Brown2006-12-14
| | | | | | If two drives in a raid5 disappear at the same time, then "-Af" will add them both in rather than just one and forcing the array to 'clean'. This is slightly safer in some cases.
* Fix and test --update=uuidNeil Brown2006-12-14
| | | | A number of odd bugs here, but now we have a regression test as well.
* Give useful message if raid4/5/6 cannot be started because it is not clean ↵Neil Brown2006-12-14
| | | | and is also degraded.
* Make Assemble/Force work on raid6 with 2 missing devices.Neil Brown2006-12-14
| | | | | | Previously it onl worked when one missing device. Also split the "force" update_super method into two and it is really serving two functions.
* Fixed problems that could cause infinitel loop with auto assemble.Neil Brown2006-11-09
| | | | | | | | | If an auto-assembly attempt failes because the array cannot be opened or because the array has already been created, then we get into an infinite loop. Reported-by: Dan Pascu <dan@ag-projects.com> Fixes-debian-bug: 396582
* Remove partitions from components of an md arrayNeil Brown2006-10-13
| | | | They do nothing but cause confusion.
* Improve the message when mdadm detects similar superblocksNeil Brown2006-10-10
| | | | | | | | If they are for a partition and a whole device (common case) they old message doesn't really cover the situation. So add the "overlap" option to the text. Also detect whether the device list was in mdadm.conf and act accordingly.
* More consistent honoring of --configfileNeil Brown2006-06-26
| | | | | Never use /etc/mdadm.conf if --config file is given (previously some code used one, some used the other).
* Fix a recently introduced bug, and make --assemble more resilient to it.Neil Brown2006-06-26
| | | | | | | Make -assemble a bit more resilient to finding strange information in superblocks. Don't claim newly added spares are InSync!! (don't know why that code was ever in there)
* Avoid misdetection of overlapping partitions...Neil Brown2006-06-02
| | | | | | | | | | | | | | | | As version-0.90 superblock don't record the superblock offset, it is possible for overlapping partitions, or a partition that starts on a 64K boundary in the whole device to result in mis-detection - one partition or device might be detected where the other was intended. To avoid this awkward possibility, we reject assembly attempts which seem to have two devices that are different but have the same version-0.90 superblock. To avoid this problem altogether, switch to version-1 metadata. Signed-off-by: Neil Brown <neilb@suse.de>
* check return status of all write/fwrite functions as required by glibc 2.4Neil Brown2006-05-29
| | | | | | | | | | | | From: Luca Berra <bluca@vodka.it> glibc 2.4 is pedantic on ignoring return values from fprintf, fwrite and write, so now we check the rval and actually do something with it. in the Grow.c case i only print a warning, since i don't think we can do anything in case we fail invalidating those superblocks (is should never happen, but then...) Signed-off-by: Neil Brown <neilb@suse.de>
* Release 2.5Neil Brown2006-05-26
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Make sure everything compiles...Neil Brown2006-05-26
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Support --auto-update-homehostNeil Brown2006-05-26
| | | | | | | | | This can be used to bootstrape homehost tagging. If no arrays are found that are tagged, we look for any array and tag it. Signed-off-by: Neil Brown <neilb@suse.de>
* Support auto-assembling of stacked devicesNeil Brown2006-05-26
| | | | | | and assorted bugfixes. Signed-off-by: Neil Brown <neilb@suse.de>