summaryrefslogtreecommitdiff
path: root/super1.c
Commit message (Collapse)AuthorAge
* Merge branch 'master' into devel-3.2NeilBrown2011-03-10
|\ | | | | | | | | | | | | | | | | Conflicts: Grow.c Manage.c managemon.c mdadm.8.in util.c
| * Assemble: add --update=no-bitmapNeilBrown2011-03-10
| | | | | | | | | | | | | | This allows an array with a corrupt internal bitmap to be assembled without the bitmap. Signed-off-by: NeilBrown <neilb@suse.de>
| * Teach --assemble --force to handle reshapes a little better.NeilBrown2011-02-21
| | | | | | | | | | | | | | | | | | | | | | When we force-assemble an array which is in the middle of a reshape, we should repeat the reshape of any parts that aren't recorded in the oldest superblock. This is unlikely to make a significant difference, but could make a small difference, and is safer. Signed-off-by: NeilBrown <neilb@suse.de>
* | Fix chunksize defaulting.NeilBrown2011-03-09
| | | | | | | | | | | | | | | | | | the new code for defaulting chunksizes didn't work quite right - default was set to late in super1/super0/ddf - defaults would over-ride values of '0' imposed by some levels - default value wasn't applied to size properly. Signed-off-by: NeilBrown <neilb@suse.de>
* | set default chunk in validate_geometryCzarnowska, Anna2011-02-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When chunk size is not set from command line we need to guess it depending on metadata given on command line or found on listed devices. Validate_geometry sets the default for it's metadata if chunk is not set. For external metadata chunk is set only when creating in a container. For imsm validate_geometry_imsm_orom is responsible for finding default chunk depending on container metadata loaded. Container will already know which controller it is attached to, and have this controllers orom available. do_default_chunk indicates that we need to find default chunk and if validate_geometry fails for some metadata it tells us to reset chunk that may have been set. Current solution would set default chunk correctly for imsm only if container device was given on command line. With the list of devices chunk was always set to 512. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | super1: fix regression in write_init_super.NeilBrown2011-01-31
| | | | | | | | | | | | | | | | | | | | | | Now that a 'supertype' container more information, the simplistic copying of 'st' into 'refst' is incorrect and results in closing some fds when load_super1(refst) calls free_super(). So do it more correctly using dup_super. Reported-by: "Labun, Marcin" <Marcin.Labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Don't close fds in write_init_superNeilBrown2011-01-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously closed all 'fds' associated with an array in write_init_super .. sometimes, and sometimes at bad times. This isn't neat and free_super is a better place to close them. So make sure free_super always closes the fds that the metadata manager kept hold of, and stop closing them in write_init_super. Also add a few more calls to free_super to make sure they really do get closed. Reported-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' into devel-3.2NeilBrown2010-12-09
|\| | | | | | | | | | | | | | | Conflicts: mdadm.8.in Same conceptual change was written with different words in each version. Signed-off-by: NeilBrown <neilb@suse.de>
| * Fix byte-order conversion in update_super1("assemble")NeilBrown2010-09-16
| | | | | | | | | | | | | | | | | | This code is wrong is several ways, and failed on big-endian machines. Put in correct endian coversions: 'want' is cpu-order, dev_roles[] is little-endian, 16 bit. Reported-by: Doug Nazar <nazard.michi@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Assemble: add --update=no-bitmapNeilBrown2010-11-30
| | | | | | | | | | | | | | This allows an array with a corrupt internal bitmap to be assembled without the bitmap. Signed-off-by: NeilBrown <neilb@suse.de>
* | Create: user container_dev rather than subarray for some tests.NeilBrown2010-11-22
| | | | | | | | | | | | | | | | | | It makes more sense to test for container_dev than for subarray for several places in Create where it then uses container_dev. This allows us to subsequently remove subarray. Signed-off-by: NeilBrown <neilb@suse.de>
* | Remove subarray detection from load_super.NeilBrown2010-11-22
| | | | | | | | | | | | Nothing relies on this any more, so remove it. Signed-off-by: NeilBrown <neilb@suse.de>
* | Add subarray arg to container_content.NeilBrown2010-11-22
| | | | | | | | | | | | | | | | | | | | This allows the info for a single array to be extracted, so we don't have to write it into st->subarray. For consistency, implement container_content for super0 and super1, to just return the mdinfo for the single array. Signed-off-by: NeilBrown <neilb@suse.de>
* | get_info_super: report which other devices are thought to be working/failed.NeilBrown2010-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To accurately detect when an array has been split and is now being recombined, we need to track which other devices each thinks is working. We should never include a device in an array if it thinks that the primary device has failed. This patch just allows get_info_super to return a list of devices and whether they are thought to be working or not. Signed-off-by: NeilBrown <neilb@suse.de>
* | Report error in --update string is not recognised.NeilBrown2010-11-22
|/ | | | | | | | If an --update is requested by the relevant metadata doesn't understand it, print a useful message rather than silently ignoring the issue. Signed-off-by: NeilBrown <neilb@suse.de>
* Compile with -Wextra by defaultNeilBrown2010-08-05
| | | | | | This produced lots of warning, some of which pointed to actual bugs. Signed-off-by: NeilBrown <neilb@suse.de>
* Don't report Used Dev Size for RAID0.NeilBrown2010-07-22
| | | | | | | | | | | | This number isn't meaningful for RAID0 as a different amount of space might be used from each device. It isn't meaningful for linear either, but already was not reported for linear. Detail doesn't report it either. So make --examine not report it. Signed-off-by: NeilBrown <neilb@suse.de> Reported-by: Mario 'BitKoenig' Holbe <Mario.Holbe@TU-Ilmenau.DE>
* Compile-time switch to enable 0.9 metadata as defaultmartin f. krafft2010-05-31
| | | | | | | | | | | | | | | | | | | | | | This commit introduces DEFAULT_OLD_METADATA as a preprocessor definition. If defined, it causes mdadm to assume metadata version 0.9 as default. If not defined, version 1.x (currently 1.2) is used as default. The man page mdadm.8 is also modified to reflect the chosen default. The selftests will not work if the old default is chosen. This patch was requested by Debian so they could distribute a current mdadm together with boot loaders that only understand 0.90 metadata for md-raid. Preferred usage is simply make DEFAULT_OLD_METADATA=yes Signed-off-by: martin f. krafft <madduck@debian.org> Signed-off-by: NeilBrown <neilb@suse.de>
* Revert change to handling of -empty-string- metadata.NeilBrown2010-05-31
| | | | | | | | | | | | | | | | | | If the metadata is an empty string, it means the array in question does not use metadata. This comes from sysfs_read finding "none" in "metadata_version", then super_by_fd noticing the vers == -1, and so just using the ->text_version (which is empty). In this case we want to use the super0 metadata handler routines because that is what we always used to do before commit 7d5c3964ccfaace123f7b75e15d38c2650e013d8 And that commit was wrong because "" doesn't mean "default" and so should not have been changed at the same time. Reported-by: martin f. krafft <madduck@debian.org> Signed-off-by: NeilBrown <neilb@suse.de>
* super1: encourage data alignment on 1Meg boundaryNeilBrown2010-03-03
| | | | | | | | | | | | | For 1.1 and 1.2 metadata where data_offset is not zero, it is important to align the data_offset to underlying block size. We don't currently have access to the particular device in avail_size so just try to force to a 1Meg boundary. Also default 1.x metadata to 1.2 as documented. Signed-off-by: NeilBrown <neilb@suse.de>
* Create: change default metadata type to 1.2NeilBrown2010-02-24
| | | | | | | | | | | | | Change default - again, sorry. v1.1 causes problems as the conflicts with a boot sector, whether on the whole device or in a partition. I guess the rule is they you aren't allowed to use the first sector in general. v1.2 is mostly just as good and avoid boot-sector problems so default to that instead. Signed-off-by: NeilBrown <neilb@suse.de>
* super1: put bitmap on a 4K boundary when possible.NeilBrown2010-02-24
| | | | | | | | Some devices have 4K sector sizes. So try to align the bitmap on a 4K boundary. This isn't possible when hot-adding a bitmap, but will be once we add support for configuring the bitmap via sysfs. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: fix --force assembly of v1.x arrays which are recovering.NeilBrown2010-02-04
| | | | | | | | | | | | | | | | 1.x metadata allows a device to be a member of the array while it is still recoverying. So it is a working member, but is not completely in-sync. mdadm/assemble does not understand this distinction and assumes that a work member is fully in-sync for the purpose of determining if there are enough in-sync devices for the array to be functional. So collect the 'recovery_start' value from the metadata and use it in assemble when determining how useful a given device is. Reported-by: Mikael Abrahamsson <swmike@swm.pp.se> Signed-off-by: NeilBrown <neilb@suse.de>
* Introduce MaxSectorDan Williams2009-12-21
| | | | | | | Replace occurrences of ~0ULL to make it clear we are talking about maximal resync/recovery position. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Various fixes for --killNeilBrown2009-11-24
| | | | | | | | | - When --kill-superblock is used with --metadata, find every different superblock if there are several and kill them all. - When creating a new array, kill off any old metadata. The code to do this was already present but has become broken over time. Signed-off-by: NeilBrown <neilb@suse.de>
* Improve error messages when metadata handler does not support request.NeilBrown2009-11-17
| | | | | | | | | ->validate_geometry is called to validate overall parameters, and to validate each individual device. If it ever fails, it needs to report the reason, as common code cannot possible know. Signed-off-by: NeilBrown <neilb@suse.de>
* Set default bitmap-chunksize for internal bitmaps to at least 64MegNeilBrown2009-11-17
| | | | | | | | | A small bitmap-chunksize hurts performance without helping resync speed much - particularly on internal bitmaps. So set the default to at least 64Meg. Signed-off-by: NeilBrown <neilb@suse.de>
* Change default metadata from 0.90 to 1.1NeilBrown2009-11-17
| | | | | | | | | 1.1 is more flexible in a number of ways and is safer. 0.90 is still fully supported. 1.0 should possibly be used for RAID1 arrays that you want to boot off, depending on your boot loader. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: include ACTIVE but not in-sync devices as non-spares.NeilBrown2009-11-17
| | | | | | | | | Previously such things did not exist: ACTIVE and SYNC were either both set or both clear. Recent changes with reshape means that a device can be ACTIVE but not yet fully in-sync, so they need to be handled and included in the array as active devices. Signed-off-by: NeilBrown <neilb@suse.de>
* Handle negative delta_disks in super0 and super1.NeilBrown2009-10-16
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'master' into devel-3.1NeilBrown2009-10-01
|\ | | | | | | | | Conflicts: mdadm.8
| * super1: remove fd leak when opening /dev/urandomNeilBrown2009-08-13
| | | | | | | | | | | | | | | | | | As reported in https://bugzilla.novell.com/show_bug.cgi?id=527722 I forgot to close the fd after reading the random number. Signed-off-by: NeilBrown <neilb@suse.de>
| * Update copyright dates and remove references to @cse.unsw.edu.auNeilBrown2009-06-02
| | | | | | | | | | | | Also removed 'paper' addresses. Signed-off-by: NeilBrown <neilb@suse.de>
* | Examine/Detail: report raid6 layoutNeilBrown2009-07-14
|/ | | | | | Somehow this was missing before... Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'master' into devel-3.0NeilBrown2009-05-11
|\ | | | | | | | | | | | | | | Conflicts: Build.c mdadm.c mdadm.h super1.c
| * Fix gcc-4.4 compiler warning.NeilBrown2009-04-29
| | | | | | | | | | | | | | | | | | Apparently the dereferencing of a type-punned pointer breaks strict aliasing rules. And we wouldn't want to do that. So just make a different array of the appropriate type and use memcpy. Resolves-Debian-bug: 505375 Signed-off-by: NeilBrown <neilb@suse.de>
* | super1 - fix brief examine.NeilBrown2009-05-11
| | | | | | | | | | | | We manage to lose some space here... Signed-off-by: NeilBrown <neilb@suse.de>
* | Make --brief even briefer.NeilBrown2009-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | conf/assemble: new config line "auto".NeilBrown2009-05-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The line 'auto' in mdadm.conf can be used to disable assembly of specific metadata types, or of all arrays. This does not affect assembly of arrays listed in mdadm.conf or on command line. auto -all will disable all auto-assembly. auto -ddf will cause mdadm to ignore ddf arrays that are not explicitly mentioned, and auto assemble anything else it finds. Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' in devel-3.0NeilBrown2009-03-10
|\|
| * super1: make sure max_dev grows enough when adding a device to an array.NeilBrown2009-03-09
| | | | | | | | | | | | | | | | | | | | There was a few kernel releases where the kernel would shrink max_dev to be just enough to hold the current number of devices. More recent kernels never shrink it. However to be as compatible as possible, if we notice that max_dev is too small to successfully add a device, increase it. Signed-off-by: NeilBrown <neilb@suse.de>
| * Fix bad metadata formattingDoug Ledford2008-10-30
| | | | | | | | | | | | | | | | | | | | | | 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>
* | super1/examine: remove confusing information.NeilBrown2009-03-09
| | | | | | | | | | | | | | | | | | The information about how slots and roles in the array lined up turned out to be confusing. So simplify it and one provide the interesting information. Signed-off-by: NeilBrown <neilb@suse.de>
* | super1 - do metadata IO in sector_size units.NeilBrown2009-03-09
| | | | | | | | | | | | | | | | | | | | | | | | | | | | If the sector size is > 512, we need to be more careful about alignment. The largest known sector size is 4096 and (fortunately) both the superblock and (in many cases) the bitmap are 4096-byte aligned. So there should be no data-overlap problems. The exception is when the bitmap is squeezed into the 3K after the superblock. This arrangement cannot currently be supported on 4K sector-size devices. Signed-off-by: NeilBrown <neilb@suse.de>
* | introduce --detail-platform to display platform raid capabilitiesDan Williams2008-12-08
| | | | | | | | | | | | | | 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>
* | allow add_to_super to return errorsDan Williams2008-11-27
| | | | | | | | | | | | Prepare add_to_super to validate disks against the platform capabilities Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Don't give array name in --examine --brief output if it is doubtful.NeilBrown2008-11-04
| | | | | | | | | | Now that mdadm.conf doesn't need an array name, we don't need to give one if the array cannot reliably provide one.
* | Merge branch 'master' into devel-3.0NeilBrown2008-10-17
|\| | | | | | | | | | | Conflicts: Manage.c
| * Grow: Fix linear-growth when devices are not all the same size.NeilBrown2008-10-15
| | | | | | | | | | | | If we add a device to a linear array which is a difference size to the other devices in the array then, for v1.x metadata, we need to make sure the size is correctly reflected in the superblock.
| * Improve reporting of layout for raid10.NeilBrown2008-10-13
| | | | | | | | | | | | | | | | | | | | | | | | 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).