summaryrefslogtreecommitdiffstats
path: root/Detail.c
Commit message (Collapse)AuthorAgeFilesLines
* Detail: Report state of FAILED when an array has too few devices to work.NeilBrown2010-01-291-32/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We already have a call to 'enough' in Detail which is the check for "do we have enough devices". We just need to calculate the required data a bit earlier, then use the same 'enough' call to possibly print FAILED. This is motivated by Debian bug 495755. The other request in that bug is not practical. It would be very nice if output of `mdadm' is more clear in case of a broken array. Currently the only hint you get from `mdadm' that your array is broken is this: # mdadm -A /dev/md0 /dev/sdc1 /dev/sdd1 /dev/sde1 /dev/sdf1 mdadm: /dev/md0 assembled from 1 drive and 3 spares - not enough to start the array. It could say something like `Your array is broken, you can't use it anymore' It is not valid to report that array as 'broken' if the user hasn't listed all the devices, which could be the case here. Resolves-Debian-Bug: 495755 Signed-off-by: NeilBrown <neilb@suse.de>
* Don't use %02d as a metadata format specifier for metadata numbers.Doug Ledford2010-01-191-3/+3
| | | | | | | It confuses us when we read the output back later Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Detail: report new-layout for RAID6 arraysNeilBrown2009-10-291-0/+5
| | | | | | We were only reporting it for RAID5 and RAID10. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'master' into devel-3.1NeilBrown2009-10-221-0/+6
|\
| * Free some malloced memory that wasn't being freed.NeilBrown2009-10-221-0/+1
| | | | | | | | | | | | | | | | | | | | As mdadm is normally a short-lived program it isn't always necessary to free memory that was allocated, as the 'exit()' call will automatically free everything. But it is more obviously correct if the 'free' is there. So this patch add a few calls to 'free' Signed-off-by: NeilBrown <neilb@suse.de>
| * Merge git://github.com/djbw/mdadmNeilBrown2009-10-191-0/+5
| |\
| | * Detail: export MD_UUID from mapfileDan Williams2009-10-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The load_super() from an mdadm --detail call may race against an mdmon update. When this happens the load_super sees an inconsistent metadata block and returns an error. The fallback path to use the map file contents lacks uuid reporting, so provide __fname_from_uuid for generically printing a uuid. Reported-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | | Merge branch 'master' into devel-3.1NeilBrown2009-10-011-10/+18
|\| | | | | | | | | | | | | | Conflicts: mdadm.8
| * | Add missing space in "--detail --brief" output.NeilBrown2009-10-011-2/+2
| |/ | | | | | | | | | | We need a space between the device name and the word "level".. Signed-off-by: NeilBrown <neilb@suse.de>
| * Detail: fix for an imsm container with a spareDan Williams2009-09-151-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Spares for imsm arrays do not have any info about the container in their metadata records. If Detail() inadvertantly picks such a device for ->get_array_info() it will end up with less than useful info for the container. So, continue to read from the disks until a non-spare device is found. This bug was found by timeouts waiting for udev to create the user-friendly container name. To detect future UUID reporting problems and a debug print to the timeout case in wait_for(). Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * Update copyright dates and remove references to @cse.unsw.edu.auNeilBrown2009-06-021-7/+2
| | | | | | | | | | | | Also removed 'paper' addresses. Signed-off-by: NeilBrown <neilb@suse.de>
* | Examine/Detail: report raid6 layoutNeilBrown2009-07-141-0/+4
|/ | | | | | Somehow this was missing before... Signed-off-by: NeilBrown <neilb@suse.de>
* Make --brief even briefer.NeilBrown2009-05-111-8/+10
| | | | | | | | | | | | | Because ---examine --brief, or --detail --brief are often used to create mdadm.conf, and because people don't want to have to update their mdadm.conf unnecessarily, we don't want to include information that might change. And now that level changing is supported, that is almost everything but UUID. So move some more fields into the "Only print with --verbose" class. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'master' into devel-3.0NeilBrown2009-02-021-2/+2
|\
| * Fix the used device size in mdadm -D output.NeilBrown2009-02-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | As get_component_size() returns the number of used sectors of a device we need halve before pringing as K, and shift the value by 9, not 10, before passing to human_size. Thanks to Andre Noll <maan@systemlinux.org> for identifying problem (and a slightly different version of this patch) Signed-off-by: NeilBrown <neilb@suse.de>
* | Create: warn when a metadata format's platform components are missingDan Williams2009-01-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the metadata handler can not find its platform support components then there is no way for it to verify that the raid configuration will be supported by the option-rom. Provide a generic method for metadata handlers to warn the user that the array they are about to create may not work as intended with a given platform. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | introduce --detail-platform to display platform raid capabilitiesDan Williams2008-12-081-0/+41
| | | | | | | | | | | | | | Metadata formats like imsm work in concert with platform firmware and hardware, so provide a way for mdadm to display this info to the user. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Detail: support MD_DEVNAME in --export for metadata-less devices.NeilBrown2008-11-041-0/+6
| | | | | | | | | | | | | | If there is no metadata (--build was used) then we need to lookup by devnum, not by uuid, to get the map entry. Signed-off-by: NeilBrown <neilb@suse.de>
* | detail: --export also provided MD_DEVNAMENeilBrown2008-11-041-0/+5
| | | | | | | | | | | | | | | | | | | | MD_NAME is the name of the array extracted directly from the metadata. MD_DEVNAME is the current working name of the array. It should appear in /dev/md. It is possibly what the user gave when creating the array. We extract it from /var/run/mdadm/map. Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' into devel-3.0NeilBrown2008-10-301-1/+1
|\|
| * Adjust major number testing to allow for extended minor number in 2.6.28NeilBrown2008-10-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | From 2.6.28, normal md device will be able to have partitions. These partitions will have a different major number. Sometimes mdadm tests the major number and so can get confused. Change these tests to test against get_mdp_major(). mdp does not use extended minor number and so this test will always be accurate. Also use /sys/dev links to map major/minor to devnum in sysfs. Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' into devel-3.0NeilBrown2008-10-301-3/+3
|\| | | | | | | | | | | | | | | Conflicts: Incremental.c super0.c super1.c
| * Fix bad metadata formattingDoug Ledford2008-10-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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-3/+3
|\| | | | | | | | | | | Conflicts: Manage.c
| * Improve reporting of layout for raid10.NeilBrown2008-10-131-3/+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).
* | Use common code to report MD_UUID for --detail --exportNeilBrown2008-09-181-2/+10
| | | | | | | | | | | | 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.
* | Report uuid in --detail --brief for ddf and intelNeilBrown2008-09-181-3/+5
| | | | | | | | The uuid is slightly fictitious but needed for array matching.
* | Teach --detail about containers and members there-of.NeilBrown2008-09-181-31/+123
|/ | | | | | | | | | Make --detail on a container more useful by suppressing irrelevant detail and adding useful detail like a list of member arrays. Ditto for members of a container: report the name of the container array. Signed-off-by: NeilBrown <neilb@suse.de>
* Clean up usage of open()Doug Ledford2008-07-241-1/+1
| | | | | | | | Fix on call that passed an invalid mode to open Don't pass a third arg unless we also pass O_CREAT Use symbolic args for 2nd and 3rd args Signed-off-by: Doug Ledford <dledford@redhat.com>
* Add "bitmap=" to "--detail --brief" output when relevant.Neil Brown2008-06-261-0/+8
| | | | | | Thanks to "Jon Nelson" <jnelson-linux-raid@jamponi.net> for the suggestion. Signed-off-by: Neil Brown <neilb@suse.de>
* add --export option to --examineKay Sievers2008-05-061-1/+1
| | | | | | | From: Kay Sievers <kay.sievers@vrfy.org> Cc: David Zeuthen <david@fubar.dk> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
* Fix problems with array.size overflowing on large arrays.Neil Brown2008-04-281-1/+1
| | | | | | | | | | | array.size is 32bits and counts K. So for arrays with more than 4Terrabytes, it can overflow. The correct number can be read from sysfs, but there are still a few places that use array.size and risk truncation. What is worse. they compare a number of kilobytes with a number of sectors !! So use get_component_size() to read the sysfs information, and be more consistent about units.
* Use sysfs info for metadata version info in Detail and elsewhere.Neil Brown2007-12-141-11/+30
|
* Find super from fd on an array.Neil Brown2007-12-141-1/+1
| | | | | We used to use the major/minor numbers, but that isn't sufficient any more, so pass the fd, and possibly check 'text' version.
* Drop the superblock arg from all metadata methods.Neil Brown2007-12-141-18/+16
| | | | It is now in the 'supertype'
* Add 'supertype' arg to almost all metadata methods.Neil Brown2007-12-141-6/+6
| | | | The 'superblock' will be moved into this structure soon.
* Allow metadata handlers to free their own superblock.Neil Brown2007-12-141-1/+3
| | | | | | 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-6/+6
|
* Add metadata version information to "--detail --brief" output.Neil Brown2007-11-131-1/+4
|
* "--export" segfaults with non-persistent super blocksTim Woods2007-07-231-1/+2
| | | | | | | From: Tim Woods <timwoods@uklinux.net> This patch fixes a NULL pointer dereference in Detail.c when running 'mdadm --detail --export' on a device with non-persistent super blocks.
* Fix compile error in Detail.cNeil Brown2007-05-221-1/+1
| | | | | 'avail' is undefined if '--export', so make sure we don't try to use it.
* Make return code for "--detail --test" more reliable.Neil Brown2007-05-211-4/+14
| | | | Missing devices as well as failed devices cause an error.
* Add --export option to --detail to use key=value pairs.Kay Sievers2007-05-081-2/+14
| | | | | | | | 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>
* Central calls to ioctl BLKGETSIZENeil Brown2006-12-141-12/+2
| | | | Instead of opencoding the same thing everywhere.
* Change 'Device Size' to 'Used Dev Size'Neil Brown2006-12-141-3/+6
| | | | | because it only shows how much of each device is actually used, not how big they are.
* Include homehost information in --detail where appropriate.Neil Brown2006-05-191-2/+2
| | | | 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>
* Detail checks if array has been started or not and includes that in report.Neil Brown2006-05-151-2/+3
| | | | Signed-off-by: Neil Brown <neilb@suse.de>
* Support new offset layout for raid10Neil Brown2006-05-151-3/+5
| | | | | | Requires 2.6.18. Signed-off-by: Neil Brown <neilb@suse.de>
* Reduce dependance on MD_SB_DISKSNeil Brown2006-03-281-1/+1
| | | | | | --monitor should now work with arrays larger than 28 devices. Signed-off-by: Neil Brown <neilb@suse.de>