summaryrefslogtreecommitdiffstats
path: root/mdadm.h
Commit message (Collapse)AuthorAgeFilesLines
* Incremental: honor an 'enough' flag from external handlersDan Williams2010-05-261-1/+3
| | | | | | | | | | | This is needed for imsm where: 1/ we want to report raid_disks as zero to allow mdadm -As to incorporate all spares 2/ we can't determine stale disks by looking at the event counts. 3/ we can't see per-subarray expectations with the info returned from the container level ->getinfo_super() Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* IMSM/DDF: don't recognised these metadata on partitions.NeilBrown2010-04-291-0/+1
| | | | | | | | | | | These metadata are not expected on partitions, and they have no way of differentiation whether which is correct if they are found both on the device and on the last partition. So if the device is a partition, refuse to read the metadata. Signed-off-by: NeilBrown <neilb@suse.de>
* Create: cleanup after failed create in duplicated array member caseDan Williams2010-04-191-0/+1
| | | | | | | | | | | | | | | | mdadm prevents creation when device names are duplicated on the command line, but leaves the partially created array intact. Detect this case in the error code from add_to_super() and cleanup the partially created array. The imsm handler is updated to report this conflict in add_to_super_imsm_volume(). Note that since neither mdmon, nor userspace for that matter, ever saw an active array we only need to perform a subset of the cleanup actions. So call ioctl(STOP_ARRAY) directly and arrange for Create() to cleanup the map file rather than calling Manage_runstop(). Reported-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* mapfile: if we putting the mapfile in a custom location via ALT_RUN, allowDoug Ledford2010-03-241-0/+3
| | | | | | a custom filename too. Signed-off-by: Doug Ledford <dledford@redhat.com>
* config: add 'homehost' option to 'AUTO' line.NeilBrown2010-03-031-1/+2
| | | | | | This allows basing auto-assembly decisions on whether the array is recorded as belonging to this host or not. Signed-off-by: NeilBrown <neilb@suse.de>
* allow redefinition of VAR_RUNLuca Berra2010-03-031-0/+11
| | | | | | | having mdmon socket under var is painful at shutdown time Signed-off-by: Luca Berra <bluca@comedia.it> Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: Handle assembling from config file which is out of order.NeilBrown2010-02-241-0/+4
| | | | | | | | | | | | Currently "mdadm -As" will process the entries in the config file in order. If any array is a component or member of a preceding array, that array will not be assembled. So if there are any failures during assembly, retry those arrays, and look until everything is assembled, or nothing more can be assembled. Signed-off-by: NeilBrown <neilb@suse.de>
* mdmon: don't monitor /proc/mounts to decide when to create .pid file.NeilBrown2010-02-081-1/+1
| | | | | | | | | | | Monitoring /proc/mounts and creating a .pid file as soon as /var/run is writable is racy. Most distros clean all non-directories from /var/run early in boot and if mdmon races with this it could lose the files as soon as they are created. Instead require that "mdmon --takeover" be run after /var is writable. Signed-off-by: NeilBrown <neilb@suse.de>
* mdmon: allow pid to be stored in different directory.NeilBrown2010-02-041-1/+11
| | | | | | | | /var/run probably doesn't persist from early boot. So if necessary, store in in /lib/init/rw or somewhere else that does persist. Signed-off-by: NeilBrown <neilb@suse.de>
* Having single function to read mdmon pid file.NeilBrown2010-02-041-1/+1
| | | | | | | We don't need three. One (signal_mdmon) wasn't even being used. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'klockwork' of git://github.com/djbw/mdadmNeilBrown2009-12-301-0/+7
|\ | | | | | | | | Conflicts: super-intel.c
| * Fix required to enable RAID arrays on SAS disks.Artur Wojcik2009-12-101-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | The patch increases the capacity of buffers used to store sysfs path names. Originally the buffers were too small to hold the canonical representation of sysfs path (in case of a SAS device, especially a device installed behind an expander). Signed-off-by: Artur Wojcik <artur.wojcik@intel.com> Reviewed-by: Andre Noll <maan@systemlinux.org> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Merge branch 'master' of git://github.com/djbw/mdadmNeilBrown2009-12-301-3/+24
|\ \
| * | imsm: add support for checkpointing via 'curr_migr_unit'Dan Williams2009-12-211-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | Unlike native md checkpointing some data about the geometry and type of the migration process is coded into curr_migr_unit. Provide logic to convert between md/{resync_start|recovery_start} and imsm/curr_migr_unit. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | Support external metadata recovery-resumeDan Williams2009-12-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Minimal changes needed to permit reassembling partially recovered external metadata arrays. The biggest logical change is that ->container_content() can now surface partially rebuilt members rather than omitting them from the disk list. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | Teach sysfs_add_disk() callers to use ->recovery_start versus 'insync' parameterDan Williams2009-12-211-2/+1
| | | | | | | | | | | | | | | | | | Also fixup 'in_sync' versus 'insync' typo. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | Introduce MaxSectorDan Williams2009-12-211-0/+1
| | | | | | | | | | | | | | | | | | | | | 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>
| * | Add scaffolding for handling md/dev-XXX/recovery_startDan Williams2009-12-211-1/+5
| |/ | | | | | | | | | | Prepare the code to handle saving a recovery checkpoint. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* / Check partition tables when creating array.Trela, Maciej2009-12-081-0/+1
|/ | | | | | | When creating an array, check if the devices have partition tables and print a warning if the table or the partitions might be destroyed by array creation. Signed-off-by: NeilBrown <neilb@suse.de>
* Various fixes for --killNeilBrown2009-11-241-1/+1
| | | | | | | | | - 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>
* Merge branch 'master' into devel-3.1NeilBrown2009-10-221-2/+8
|\
| * Monitor: add option to specify rebuild incrementsZdenek Behan2009-10-191-1/+1
| | | | | | | | | | | | | | | | | | | | ie. the percent increments after which RebuildNN event is generated This is particulary useful when using --program option, rather than (only) syslog for alerts. Signed-off-by: Zdenek Behan <rain@matfyz.cz> Signed-off-by: NeilBrown <neilb@suse.de>
| * mdmon: preserve socket over chrootDan Williams2009-10-131-1/+1
| | | | | | | | | | | | | | | | | | | | Connect to the monitor in the old namespace and use that connection for WaitClean requests when stopping the victim mdmon instance. This allows ping_monitor() to work post chroot(). Cc: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * Detail: export MD_UUID from mapfileDan Williams2009-10-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * imsm: add --update=uuid supportDan Williams2009-10-131-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When disks have conflicting container memberships (same container ids but incompatible member arrays) --update=uuid can be used to move offenders to a new container id by changing 'orig_family_num'. Note that this only supports random updates of the uuid as the actual uuid is synthesized. We also need to communicate the new 'orig_family_num' value to all disks involved in the update. A new field 'update_private' is added to struct mdinfo to allow this information to be transmitted. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Assemble: print more verbose messages about restarting a reshapeNeilBrown2009-10-201-1/+1
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' into devel-3.1NeilBrown2009-10-011-7/+4
|\| | | | | | | | | Conflicts: mdadm.8
| * Exmaine/brief: put member arrays after container arrays.NeilBrown2009-08-071-0/+1
| | | | | | | | | | | | | | | | | | A previous patch moved move the '--examine --brief' reporting of member arrays to before their containers. This breaks "mdadm -As" assembly. So put them back, but still fix the problem addressed by previous patch. Signed-off-by: NeilBrown <neilb@suse.de>
| * imsm: fix family number handlingDan Williams2009-07-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The family_number field can change. The option-rom will change the family number when it starts a rebuild process (flags a container for rebuild). This was not seen previously as mdadm would usually start the rebuild process, preserving the family number. This is the mechanism that helps to prevent a prodigal array member from being returned to its original system and cause a rebuild to go in the wrong direction. With the change we will end up with a container that will fail to assemble unless the device with the incompatible family number is left out of the assembly. So, take several actions: 1/ Convert uuid generation to use orig_family_num, being careful to preserve the existing uuid in the case where orig_family_num is not set (i.e. previous mdadm created imsm arrays) 2/ Set orig_family_num at Create. For arrays created by mdadm prior to this release orig_family_num will be zero, so set it to family_num at the first metadata write. 3/ Add checks for orig_family_num to compare_super_imsm 4/ Update the family number when initiating rebuild 5/ The option-rom mixes some random data into the family number, add this functionality to the mdadm implementation. Reported-by: Marcin Labun <marcin.labun@intel.com> 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>
* | Grow: support restart of new migrations.NeilBrown2009-08-131-1/+2
| |
* | Handle extra 'grow' variations.NeilBrown2009-08-111-0/+4
| | | | | | | | UNFINISHED
* | restripe: support saving when not all devices are present.NeilBrown2009-07-141-1/+2
| |
* | Grow: pass layout as a string rather than a number.NeilBrown2009-07-141-1/+1
| | | | | | | | | | | | | | | | This allows the layout to be parsed after the current level of the array is know, so that the level doesn't need to be given (otherwise pointlessly) on the command line. Signed-off-by: NeilBrown <neilb@suse.de>
* | Remove Manage_reconfing in favour of Grow_reshapeNeilBrown2009-07-141-1/+0
| | | | | | | | | | | | | | | | Bother Manage_reconfig and Grow_reshape provide for changing the 'layout' of a faulty array. This is no necessary. So discard Manage_reconfig and just use Grow_reshape Signed-off-by: NeilBrown <neilb@suse.de>
* | main: factor out code to parse layout for raid10 and faulty.NeilBrown2009-07-141-0/+2
| | | | | | | | | | | | This will soon be called from multiple places. Signed-off-by: NeilBrown <neilb@suse.de>
* | Grow: support --array-size changesNeilBrown2009-07-131-0/+1
|/ | | | | | | | | With 2.6.30 it is possible to tell the md driver to clip an array to a size smaller than the real size of the array. This option gives access to that feature. The size change does not persist across restarts. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'master' into devel-3.0NeilBrown2009-05-111-1/+1
|\ | | | | | | | | | | | | | | Conflicts: Build.c mdadm.c mdadm.h super1.c
| * mdadm: allow build to use --sizePaul Clements2009-04-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables the --size parameter for build operations. Without this, if you have a raid1, for instance, where the 2 disks are not the exact same size, and you need to build the array but one of the disks is not available right at the moment (maybe it's USB and it's unplugged, or maybe it's a network disk and it's unavailable), then you have to play some weird games to get the array to size correctly (that is, to the size of the smaller of the two components or less). There may be other uses for this too... -- Paul Signed-off-by: NeilBrown <neilb@suse.de>
* | mapfile - when rebuilding, choose an appropriate name is none is found.NeilBrown2009-05-111-0/+1
| | | | | | | | | | | | | | | | When rebuilding the mapfile (mdadm -Ir), if not appropriate name is found in /dev/md/, try to find an appropriate name, either by looking in mdadm.conf or by using the name in the metadata. Signed-off-by: NeilBrown <neilb@suse.de>
* | Allow homehost to be largely ignored when assembling arrays.NeilBrown2009-05-111-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If mdadm.conf contains HOMEHOST <ignore> or commandline contains --homehost=<ignore> then the check that array metadata mentions the given homehost is replace by a check that the name recorded in the metadata is not already used by some other array mentioned in mdadm.conf. This allows more arrays to use their native name rather than having an _NN suffix added. This should only be used during boot time if all arrays required for normal boot are listed in mdadm.conf. If auto-assembly is used to find all array during boot, then the HOMEHOST feature should be used to ensure there is no room for confusion in choosing array names, and so it should not be set to <ignore>. Signed-off-by: NeilBrown <neilb@suse.de>
* | Make --brief even briefer.NeilBrown2009-05-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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' of git://github.com/djbw/mdadm into devel-3.0NeilBrown2009-04-141-0/+3
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: Grow.c mdadm.h sysfs.c Due to independent fixes for the "mdadm hangs if reshape finishes too quickly" problem.
| * | Grow: fix hang when reshape completes too fastDan Williams2009-04-121-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For short reshapes the kernel may be done before mdadm can check that progress has passed the critical section. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: set array size at Create/AssembleDan Williams2009-04-121-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | imsm arrays round down the effective array size to the closest 1 megabyte boundary so teach get_info_super_imsm and sysfs_set_array to set 'md/array_size' if available (and make sure ddf uses the default size). Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | | incremental_container: preserve 'in_sync' flag when adding to existing array.NeilBrown2009-04-141-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building container members with -IR, we need to ensure that devices added to an active array preserve the 'in_sync' status so they don't needlessly get rebuilt. So allow sysfs_add_disk to do this (only works in kernels since 2.6.30) and pass the relevant flag down. Signed-off-by: NeilBrown <neilb@suse.de>
* | | wait_for improvement.NeilBrown2009-04-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | wait not only for the name to appear, but for it to refer to the correct device. Sometimes old symlinks left lying around can be confusing. Signed-off-by: NeilBrown <neilb@suse.de>
* | | grow: don't wait forever for critical section to pass.NeilBrown2009-04-011-0/+2
|/ / | | | | | | | | | | | | | | | | | | If an array reshape completed within 1 second, then --grow will not notice that it has finished and will keep waiting for the critical section to pass. So be more cautious in the test. Signed-off-by: NeilBrown <neilb@suse.de>
* | Support new raid6 layouts needed for DDFNeilBrown2009-03-091-2/+38
| | | | | | | | | | | | | | | | DDF raid6 layouts are subtly different from the standard 'md' layouts. From 2.6.30 the kernel knows about these. Teach mdadm about them, and also allow 'ddf' to set an appropriate default. Signed-off-by: NeilBrown <neilb@suse.de>