summaryrefslogtreecommitdiffstats
path: root/super0.c
Commit message (Collapse)AuthorAgeFilesLines
* allow add_to_super to return errorsDan Williams2008-11-271-1/+3
| | | | | | Prepare add_to_super to validate disks against the platform capabilities Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Merge branch 'master' into devel-3.0NeilBrown2008-10-301-1/+1
|\ | | | | | | | | | | | | | | Conflicts: Incremental.c super0.c super1.c
| * Fix bad metadata formattingDoug Ledford2008-10-301-1/+4
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge branch 'master' into devel-3.0NeilBrown2008-10-171-4/+3
|\| | | | | | | | | | | Conflicts: Manage.c
| * Improve reporting of layout for raid10.NeilBrown2008-10-131-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | Showing e.g. near=1, far=2 for the 'far2' layout of raid10 is confusing even though there is a sense in which is it correct. Make it less confusing by only printing whichever number is not 1. If both are 1, make that clear too (i.e. no redundancy).
* | trivial warn_unused_result squashingDan Williams2008-10-151-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Use common code to report MD_UUID for --detail --exportNeilBrown2008-09-181-13/+0
| | | | | | | | | | | | As we need to be able to extract a UUID from any superblock for matching, use that as the MD_UUID as it will probably be used for array matching too.
* | Ignore leading zeros in version number information.NeilBrown2008-09-181-0/+3
| | | | | | | | --detail sometimes generates leading zero which are just noise.
* | Compile fixes, particularly moving more stuff under MDASSEMBLENeilBrown2008-09-181-2/+7
| | | | | | | | Now 'make everything' works again.
* | Allow metadata handlers to communicate desired safemode delay via mdinfoDan Williams2008-09-151-0/+1
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Pass 'verbose' flag to validate_geometryNeil Brown2008-07-121-3/+6
| | | | | | | | | | That way it can be silent when we are just trying to figure out which metadata to use, and noisy when detecting a real problem.
* | Use O_DIRECT for all IO to devices.Neil Brown2008-07-121-15/+18
| | | | | | | | | | | | | | | | Using buffered IO risks non-atomic updates to parts of the device that we don't actually want to write to. This isn't in general safe. So switch to O_DIRECT for all that IO and make sure we have properly aligned buffers.
* | Make super super0.c function static.Neil Brown2008-07-121-3/+3
| | | | | | | | So only 'super0' is externally visible.
* | Remove silly convention that major='-1' means 'zero superblock'.Neil Brown2008-07-121-1/+1
| | | | | | | | Use 'info pointer is NULL' instead.
* | Remove getinfo_super_n and do some other cleaning up.Neil Brown2008-07-121-1/+3
| | | | | | | | | | Getting close to a sensible description of what some of the superswitch methods are supposed to do!
* | Add subarray field to supertype.Neil Brown2008-07-121-0/+3
| | | | | | | | | | | | | | | | | | When loading the metadata for a subarray (super_by_fd), we set ->subarray to be the name read from md/metadata_version so that getinfo_super can return info about the correct array. With this we can differentiate between a container and an array within the container by looking at ->subarray[0].
* | Remove 'major' from superswitch.Neil Brown2008-07-121-1/+0
| | | | | | | | It isn't generally meaningful.
* | Use text_version in map_file rather than major.minor.Neil Brown2008-07-121-0/+2
| |
* | Fix write_init_super usage when hot-adding a spareNeil Brown2008-07-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Using write_init_super to add a spare to an active array is quite different to how it is used when creating an array. It mostly works, but if we are adding two devices to an array, then when we add the second, there are still traces of the first which confuse write_init_super. So get write_init_super to ignore those traces. Longer term, we probably want to do this differently as for DDF, hot-adding to an active array will have to be quite different - it will want to write to all metadata, possibly via mdmon.
* | Always initialise a struct super_type to zeroNeil Brown2008-07-121-0/+1
| |
* | Merge branch 'master' into devel-3.0Neil Brown2008-06-191-1/+4
|\| | | | | | | | | | | Conflicts: Makefile
| * Fix an error when assembling arrays that are in the middle of a reshape.Neil Brown2008-06-191-1/+4
| | | | | | | | | | | | It is important that dup_super always returns an 'st' with the same ->ss and ->minor_version as the st that was passed. This wasn't happening for 0.91 metadata (i.e. in the middle of a reshape).
* | Change write_init_super to be called only once.Neil Brown2008-05-151-19/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+38
|/ | | | These will be used for ddf.
* Fix support for --update=swapsuperNeil Brown2008-05-151-1/+2
| | | | The user of dup_super broke it.
* Recent change broken handling of metadata-less arrays.Neil Brown2008-05-151-1/+2
| | | | | In particular, failing a device would give a silly error message.
* add --export option to --examineKay Sievers2008-05-061-2/+22
| | | | | | | From: Kay Sievers <kay.sievers@vrfy.org> Cc: David Zeuthen <david@fubar.dk> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
* Small improvements to --incremental for arrays that are in the middle of reshapeNeil Brown2008-04-281-1/+2
| | | | | | There is still a problem: If array is partially assembled and started read-only, the last device doesn't get added properly. Probably a kernel problem.
* Print 'Events' more sensibly.Neil Brown2008-04-281-1/+3
| | | | Instead of MSW.LSW, just print it as a 64bit number.
* Drop the superblock arg from all metadata methods.Neil Brown2007-12-141-45/+49
| | | | It is now in the 'supertype'
* Fix compare_super to take supertype instead of a superblock.Neil Brown2007-12-141-5/+8
| | | | | 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-17/+18
| | | | 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.
* Remove spaces/tabs from ends of lines.Neil Brown2007-12-141-7/+7
|
* Fix error message when adding a device that is too small.Neil Brown2007-08-201-6/+6
| | | | | We were multiplying MD_RESERVED_SECTORS by 1024 instead of 512, so lots of 'is it too small' checks were wrong.
* Fix --grow --add for linear arrays.Neil Brown2007-05-211-3/+10
| | | | | | | | | | | | | 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.
* Add --export option to --detail to use key=value pairs.Kay Sievers2007-05-081-0/+13
| | | | | | | | 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>
* Release 2.6mdadm-2.6Neil Brown2006-12-211-3/+3
|
* Add new mode: --incrementalNeil Brown2006-12-211-0/+3
| | | | | --incremental allows arrays to be assembled one device at a time. This is expected to be used with udev.
* Support --uuid= with --create to choose your own UUID.Neil Brown2006-12-141-11/+18
|
* Central calls to ioctl BLKGETSIZENeil Brown2006-12-141-46/+14
| | | | Instead of opencoding the same thing everywhere.
* Change 'Device Size' to 'Used Dev Size'Neil Brown2006-12-141-1/+2
| | | | | 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.
* Improve allocation and use of space for bitmaps in version1 metadataNeil Brown2006-12-141-2/+6
| | | | | | | | | | 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-17/+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.
* Make --examine report chunk size when it shouldNeil Brown2006-10-091-0/+2
| | | | Currently it doesn't for raid6 and raid10
* Remove indeterminism from names in --examine --brief output.Neil Brown2006-08-111-5/+0
| | | | | | | | | | | | It is much better for this sort of thing to be predictable rather than depending on what devices exist, especially as these days entries in /dev/ often don't pre-exist. So make it always /dev/mdX for version0 superblocks. Version1 are always /dev/md/NAME
* Fix a recently introduced bug, and make --assemble more resilient to it.Neil Brown2006-06-261-1/+1
| | | | | | | 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)
* Remove libssl dependancy and always use sha1.c codeNeil Brown2006-06-021-20/+22
| | | | | | | | Apparently there are license issues with openssl, so just use sha1.c always. This means we can get rid of SHA1.c Signed-off-by: Neil Brown <neilb@suse.de>