summaryrefslogtreecommitdiffstats
path: root/super1.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Change write_init_super to be called only once.Neil Brown2008-05-151-96/+129
| | | | | | | | | | | | | | | | | | | | | The current model for creating arrays involves writing a superblock to each device in the array. With containers (as with DDF), that model doesn't work. Every device in the container may need to be updated for an array made from just some the devices in a container. So instead of calling write_init_super for each device, we call it once for the array and have it iterate over all the devices in the array. To help with this, ->add_to_super now passes in an 'fd' and name for the device. These get saved for use by write_init_super. So add_to_super takes ownership of the fd, and write_init_super will close it. This information is stored in the new 'info' field of supertype. As part of this, write_init_super now removes any old traces of raid metadata rather than doing this in common code.
* Add 'container' level and ->validate_geometry method.Neil Brown2008-05-151-1/+31
| | | | These will be used for ddf.
* add --export option to --examineKay Sievers2008-05-061-2/+37
| | | | | | | From: Kay Sievers <kay.sievers@vrfy.org> Cc: David Zeuthen <david@fubar.dk> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
* Fix possible bug with bitmap space allocation with v1.0 metadataNeil Brown2008-04-291-1/+3
| | | | | When adding a device to an array, make sure we don't reserve so much space for the bitmap that there isn't room for the data.
* Drop the superblock arg from all metadata methods.Neil Brown2007-12-141-58/+62
| | | | It is now in the 'supertype'
* Fix compare_super to take supertype instead of a superblock.Neil Brown2007-12-141-4/+7
| | | | | 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-13/+14
| | | | The 'superblock' will be moved into this structure soon.
* Allow metadata handlers to free their own superblock.Neil Brown2007-12-141-0/+7
| | | | | | As the metadata handler allocates the superblock, it should free it too. DDF will have a more complex 'superblock' which needs more complex freeing.
* Clarify the avail/used devices sizes with version1 superblock.Neil Brown2007-10-171-2/+2
| | | | | Not all of the device may be available. Of that, not all may be used (if devices are of different sizes).
* Also use &tst instead of st later on when loading v1 superblocksJérémy Bobbio2007-10-011-1/+1
|
* Fix segfault on assembly on amd64 with v1 superblocksmartin f. krafft2007-09-301-1/+1
| | | | | | | | Commit a40b4fe introduced a temporary supertype variable tst, instead of manipulating st directly. However, it was forgotton to pass &tst into the recursive load_super1 call, causing an infinite recursion. Signed-off-by: martin f. krafft <madduck@debian.org>
* Don't corrupt 'supertype' when speculatively calling load_super1Neil Brown2007-09-241-9/+10
| | | | | | | | When load_super1 is trying to see which sub-version of v1 superblock is present, failure will cause it to clear st->ss, which is not good. So use a temporary 'super_type' for the 'test if this version works' calls, then copy that into 'st' on success.
* Fix problem with add a device to a 1.x array created with older mdadm.Neil Brown2007-08-201-0/+4
| | | | | | When adding new disk to an array, don't reserve so much bitmap space that the disk cannot store the required data. (Needed when 1.x array was created with older mdadm).
* Interpret "--metadata=1" with --assemble to imply any version-1, not just 1.0Doug Ledford2007-07-091-8/+29
| | | | | | | | | | | | | | | | | | | | | | From: Doug Ledford <dledford@redhat.com> OK, this one fixes an issue where people were doing manual array creation and specifying superblock types other than 1.0 (aka, 1.1, 1.2) and then using mdadm -Ebs to populate their mdadm.conf file. The general problem is that if you specify a superblock type in the ARRAY line (or on the command line), then you must specify the superblock type *exactly*, including the minor version. Unfortunately, mdadm -Ebs prints out all version 1 superblocks, regardless of minor version, as just plain old 1. This breaks the mdadm.conf file for anything other than plain version 1 superblock devices. So, since I thought it was basically backwards that the mdadm -E output was lax on specifying the location of the superblock where as the mdadm -A input was strict, I reversed that. With this patch, the mdadm -E output is now exact for any given superblock. But, in addition, the mdadm -A input is now lax for any superblock that doesn't specifically list the minor version, aka version 1 now means version 1, not version 0.90, but any minor version. So does default/large.
* Update tests and add linear-addNeil Brown2007-05-211-0/+1
| | | | | | Update the testing scripts to allow for new space calculations for space for bitmaps. Add a test script for adding devices to linear arrays.
* Fix --grow --add for linear arrays.Neil Brown2007-05-211-4/+27
| | | | | | | | | | | | | The new superblock needs to have a new disk.number. This is a bit of a hack... Fix handling of negative bitmap offsets on 64bit hosts. The bitmap offset is a signed 32bit number, so casting to (long) isn't sufficient. We must cast to (int32_t). Fix various problems with --grow --add for linear. The code to add a drive to a live linear array had never been tested properly and so was buggy. This tidies it up and means that the new regression-test passes.
* Fix handling of negative bitmap offsets on 64bit hosts.Neil Brown2007-05-211-2/+2
| | | | | The bitmap offset is a signed 32bit number, so casting to (long) isn't sufficient. We must cast to (int32_t).
* Add --export option to --detail to use key=value pairs.Kay Sievers2007-05-081-0/+23
| | | | | | | | udev likes to get information about a device as key=value pairs so it can create disk/by-id links etc. So add --export flag which causes the output of --detail to easily parsable. From: Kay Sievers <kay.sievers@novell.com>
* Fix up calculation of bitmap space when creating v1 metadata.Neil Brown2007-05-081-31/+20
| | | | | | | We have the same calculation in multiple places with subtle differences. So unite it all. Also fix up and endian problem in --examine.
* A couple of casts needed in printf statements.Neil Brown2007-02-221-2/+4
|
* Fix a warning about an uninitialised variable.Neil Brown2007-02-221-0/+2
| | | | | The case that doesn't initialise it is impossible, so just return with an error..
* Centralise code for copying uuidNeil Brown2006-12-141-26/+4
| | | | Rather than opencoding the byteswap all the time.
* Support --uuid= with --create to choose your own UUID.Neil Brown2006-12-141-8/+23
|
* Fix bug where v1 superblock might appear active when they should be clean.Neil Brown2006-12-141-1/+3
| | | | Only happens on kernel with 32 bit sector_t.
* Central calls to ioctl BLKGETSIZENeil Brown2006-12-141-36/+10
| | | | Instead of opencoding the same thing everywhere.
* Fix and test --update=uuidNeil Brown2006-12-141-2/+14
| | | | A number of odd bugs here, but now we have a regression test as well.
* When resync finished, report the mismatch count if there is one.Neil Brown2006-12-141-1/+1
| | | | | This doesn't get mailed out, but will appear in syslog... Maybe it should be mailed if it was a 'check' or 'repair' pass...
* Change 'Device Size' to 'Used Dev Size'Neil Brown2006-12-141-1/+3
| | | | | because it only shows how much of each device is actually used, not how big they are.
* Give useful message if raid4/5/6 cannot be started because it is not clean ↵Neil Brown2006-12-141-0/+1
| | | | and is also degraded.
* Fix a misleading comment.Neil Brown2006-12-141-1/+3
|
* Support --update=devicesize for cases where the underlying device can change ↵Neil Brown2006-12-141-5/+29
| | | | size.
* Improve allocation and use of space for bitmaps in version1 metadataNeil Brown2006-12-141-27/+99
| | | | | | | | | | Depending on the size of the array we reserve space for up to 128K of bitmap, and we use it where possible. When hot-adding to a version 1.0 we can still only use the 3K at the end though - need a sysfs interface to improve that. If a small chunksize is requested on Create, we don't auto-enlarge the reserved space - this still needs to be fixed.
* Remove some unused interfaces to the metadata handlers.Neil Brown2006-12-141-20/+0
| | | | | This stuff has never been used (at least as far as git history can see). I wonder why it was there...
* Make Assemble/Force work on raid6 with 2 missing devices.Neil Brown2006-12-141-1/+9
| | | | | | Previously it onl worked when one missing device. Also split the "force" update_super method into two and it is really serving two functions.
* --update=resync did exactly the wrong thing for version1 metadata.Neil Brown2006-11-121-1/+1
|
* Fixed UUID printing in "--detail --brief" for version1 metadata.Neil Brown2006-11-091-1/+1
|
* Increase default size of bitmap for v1 superblocks.Neil Brown2006-10-191-1/+1
| | | | | It can be increased further, but that takes a bit more code so will wait for 2.6.
* Fix array-subscript error.Neil Brown2006-10-191-1/+1
| | | | | ->name is sized to '33' to have room for a trailing nul, but thhat needs to get put in position '32'. Doh!
* Fix typo in earlier patch.Neil Brown2006-10-091-1/+1
| | | | Thanks Martin Krafft
* Fix some endian-ness issues with v1 superblocks.Neil Brown2006-10-091-8/+16
|
* Work around bug in --add handling for version-1 superblocksNeil Brown2006-06-261-1/+5
| | | | | | | | | In 2.6.17 (and prior), the dev_number is ignored when a device is added to an active array. Rather the first free number is used. So we work around this by making sure we use the first free number for dev_number. Description...
* Add 'Array Slot' line to --examine for version-1 superblocksNeil Brown2006-06-261-0/+12
| | | | to make it a bit easier to see what is happening.
* Move a variable declaration to the declaration area.Paul Clements2006-06-201-2/+1
| | | | | | | | While declaring variables in the middle of code withs with newer gcc's it doesn't work with older, and it is arguably less readable, so just do the right thing. From: Paul Clements <paul.clements@steeleye.com>
* Fix problem with post-increment usage in macroPaul Clements2006-06-201-2/+4
| | | | | | Bad/bad/bad, and cause compiler error on ppc (gcc 3.2.3). From: Paul Clements <paul.clements@steeleye.com>
* Fix offsetof macro for 64bit hostsNeil Brown2006-06-161-1/+1
|
* check return status of all write/fwrite functions as required by glibc 2.4Neil Brown2006-05-291-1/+2
| | | | | | | | | | | | 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-1/+1
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Improve names reported by --examine --briefNeil Brown2006-05-261-1/+11
| | | | | | | Instead of depending (too much) on what is in /dev, we make names based on the content of the superblock. Signed-off-by: Neil Brown <neilb@suse.de>
* When assembly arrays using incomplete detail, prefer arrays built for this host.Neil Brown2006-05-231-0/+11
| | | | | | | | 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>
* Support --update=homehost to allow updating of homehost information.Neil Brown2006-05-231-0/+11
| | | | Signed-off-by: Neil Brown <neilb@suse.de>