summaryrefslogtreecommitdiffstats
path: root/super1.c
Commit message (Collapse)AuthorAgeFilesLines
* 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-131-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-101-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>
* Allow --update=name to update the name during assembly.Neil Brown2006-05-231-0/+13
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Make sure homehost is set correctly when --update=uuidNeil Brown2006-05-231-1/+3
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Include homehost information in --examine as appropriateNeil Brown2006-05-191-3/+8
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Include homehost information in --detail where appropriate.Neil Brown2006-05-191-4/+9
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Make homehost information appear in superblock.Neil Brown2006-05-191-4/+18
| | | | | | | | When an array is created, if the homehost is know, the superblock gets it, either in the uuid, (via sha1) or in the name field. 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>
* When updating uuid, update the bitmap as well - internal bitmaps.Neil Brown2006-05-161-7/+46
| | | | | | | Otherwise when you "--update==uuid" an array with an internal bitmap, it will break, badly. Signed-off-by: Neil Brown <neilb@suse.de>
* Support new offset layout for raid10Neil Brown2006-05-151-3/+6
| | | | | | Requires 2.6.18. Signed-off-by: Neil Brown <neilb@suse.de>
* [PATCH] Make sure update_super returns correct value.Neil Brown2006-04-281-0/+7
| | | | | | | | | | | | | | | | For 'force' and 'assemble', update_super must return true if anything was changed. Also fix a bug with wonly handling in super0. Signed-off-by: Neil Brown <neilb@suse.de> ### Diffstat output ./super0.c | 18 ++++++++++++++---- ./super1.c | 7 +++++++ 2 files changed, 21 insertions(+), 4 deletions(-) diff ./super0.c~current~ ./super0.c
* Fix alignment problem in version-1 superblocks.Neil Brown2006-04-071-1/+1
| | | | | | | | NOTE: This is an incompatable change affecting raid5 reshape. If you want to reshape a raid5 using version-1 superblocks, use 2.6.17-rc2 or later, and mdadm-2.4.1 or later. Signed-off-by: Neil Brown <neilb@suse.de>
* Add information about reshape to --detailNeil Brown2006-03-281-2/+2
| | | | | | Also fix problems with dev names and symlinks Signed-off-by: Neil Brown <neilb@suse.de>
* Remove ident arg from getinfo_super;Neil Brown2006-03-271-3/+3
| | | | | | Add a 'name' field to 'info' to compensate. Signed-off-by: Neil Brown <neilb@suse.de>