summaryrefslogtreecommitdiffstats
path: root/Assemble.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix bug in forced assemble.Chris Webb2008-10-151-1/+1
| | | | | | | We are loading into the already-loaded 'st' instead of the newly create 'tst', which is clearly wrong. Resolves Debian Bugs 496334/499643/498505
* Avoid NULL reference calling free_super and elsewhere.Neil Brown2008-05-271-5/+7
| | | | | | | 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-271-1/+1
| | | | Causes compile error with gcc-2.95
* Fix autoassemble for stack arrays.Neil Brown2008-05-201-3/+9
| | | | | | | | 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.
* Avoid possible null dereference in Assemble.Neil Brown2008-05-151-1/+2
| | | | | 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-141-56/+56
| | | | | 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-141-3/+0
| | | | We don't use the information at all (any longer).
* Drop the superblock arg from all metadata methods.Neil Brown2007-12-141-56/+61
| | | | It is now in the 'supertype'
* Fix compare_super to take supertype instead of a superblock.Neil Brown2007-12-141-1/+1
| | | | | 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-141-23/+27
| | | | The 'superblock' will be moved into this structure soon.
* Allow metadata handlers to free their own superblock.Neil Brown2007-12-141-36/+26
| | | | | | 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-141-3/+3
|
* Fix bug where v1 superblock might appear active when they should be clean.Neil Brown2006-12-141-1/+1
| | | | Only happens on kernel with 32 bit sector_t.
* Central calls to ioctl BLKGETSIZENeil Brown2006-12-141-2/+2
| | | | Instead of opencoding the same thing everywhere.
* Change handling for "--assemble --force" when two drives disappeared at once.Neil Brown2006-12-141-1/+21
| | | | | | 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-141-4/+8
| | | | 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-141-3/+28
| | | | and is also degraded.
* Make Assemble/Force work on raid6 with 2 missing devices.Neil Brown2006-12-141-5/+7
| | | | | | 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-091-3/+19
| | | | | | | | | 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-131-0/+4
| | | | They do nothing but cause confusion.
* Improve the message when mdadm detects similar superblocksNeil Brown2006-10-101-3/+6
| | | | | | | | 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-261-2/+2
| | | | | 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-261-0/+4
| | | | | | | 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-021-0/+19
| | | | | | | | | | | | | | | | 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-291-1/+3
| | | | | | | | | | | | 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.5mdadm-2.5Neil Brown2006-05-261-2/+7
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Make sure everything compiles...Neil Brown2006-05-261-1/+4
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Support --auto-update-homehostNeil Brown2006-05-261-3/+31
| | | | | | | | | 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-261-1/+19
| | | | | | and assorted bugfixes. Signed-off-by: Neil Brown <neilb@suse.de>
* Initial implementation of auto-assemblyNeil Brown2006-05-261-8/+60
| | | | | | This basically works, but needs various improvements and some tests. Signed-off-by: Neil Brown <neilb@suse.de>
* Allow autoassembly to choose it's own name for the array.Neil Brown2006-05-231-19/+32
| | | | | | | | | This cannot be used yet, but it is working towards auto-assembly. When auto-assembling an array, we make a name in /dev/md/ giving a number (from the peferred minor) or name (from set-name). Signed-off-by: Neil Brown <neilb@suse.de>
* When assembly arrays using incomplete detail, prefer arrays built for this host.Neil Brown2006-05-231-5/+35
| | | | | | | | i.e. if assembling with --name or --super-minor, then if we find two different arrays with the same apparent identity, and one was built for 'this' host, then prefer that one instead of giving up in disgust. Signed-off-by: Neil Brown <neilb@suse.de>
* Reorganise Assemble code somewhat.Neil Brown2006-05-231-7/+30
| | | | | | | | | | | We make sure all devices can are consistent before doing any --update This saves us from updating some but not all of an array, and then aborting. It also means we can backtrack on out decisions, which we might want to do later. Signed-off-by: Neil Brown <neilb@suse.de>
* Make sure name matching for array assembly understand the possibility of a ↵Neil Brown2006-05-231-1/+21
| | | | | | | | | homehost This "--assemble --name=foo" on host 'bar' will assemble an array named 'foo' or 'bar:foo'. Signed-off-by: Neil Brown <neilb@suse.de>
* Allow --update=name to update the name during assembly.Neil Brown2006-05-231-1/+1
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Make sure homehost is set correctly when --update=uuidNeil Brown2006-05-231-7/+12
| | | | 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>
* New flag --no-degradedNeil Brown2006-05-191-9/+12
| | | | | | | | | Use to avoid starting arrays if there are fewer devices available than last time the array was started. This is only needed with --scan, as with --scan, that behaviour is the default. Signed-off-by: Neil Brown <neilb@suse.de>
* When updating uuid, update the bitmap as well - external bitmapsNeil Brown2006-05-161-0/+4
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Support 'bitmap=' in mdadm.conf for auto-assembling arrays with write-intent ↵Neil Brown2006-03-291-1/+15
| | | | | | bitmaps in separate files. Signed-off-by: Neil Brown <neilb@suse.de>
* Allow resize to backup to a file.Neil Brown2006-03-271-2/+2
| | | | | | | | | | To support resizing an array without a spare, mdadm now understands --backup-file= which should point to a file for storing a backup of critical data. This can be given to --grow which will create the file, or --assemble which will restore from the file if needed. Signed-off-by: Neil Brown <neilb@suse.de>
* Remove ident arg from getinfo_super;Neil Brown2006-03-271-5/+4
| | | | | | Add a 'name' field to 'info' to compensate. Signed-off-by: Neil Brown <neilb@suse.de>
* Release 2.4-pre1Neil Brown2006-03-201-0/+2
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Support restarting of a reshape on --assembleNeil Brown2006-03-201-1/+32
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Assorted fixes...Neil Brown2006-01-271-1/+3
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Support updating of uuid during --assemble.Neil Brown2005-12-051-2/+16
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Allow event counters to be off by oneNeil Brown2005-12-051-1/+3
| | | | | | .. even without --force Signed-off-by: Neil Brown <neilb@suse.de>
* Improve option parsingNeil Brown2005-12-051-4/+1
| | | | | | | | stuff ====Do Not Remove==== Status: ok Signed-off-by: Neil Brown <neilb@suse.de>
* Allow scanning of devices listed in /proc/partitions independant of /devNeil Brown2005-12-051-5/+5
| | | | | | | 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>
* Fix assembling of array with spares when verion-1 superblock is used.Neil Brown2005-09-121-0/+6
| | | | | | | As spared don't have a position in the raid array with verion-1 superblocks, we need to handle them a bit differently. Signed-off-by: Neil Brown <neilb@suse.de>