summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | DDF: minor formatting improvementNeilBrown2009-03-091-1/+1
| | | | | | | | avoid long lines in --examine output
* | Support new raid6 layouts needed for DDFNeilBrown2009-03-094-21/+120
| | | | | | | | | | | | | | | | 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>
* | super1/examine: remove confusing information.NeilBrown2009-03-091-4/+21
| | | | | | | | | | | | | | | | | | 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-091-7/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | super0: Do all metadata IO with 4096byte alignmentNeilBrown2009-03-091-11/+14
| | | | | | | | | | | | | | | | | | .. because some devices (dasd) have 4096 byte sector size. As the superblock is 4096 bytes and the bitmap is in a 60K region, this is safe from any possible corruption. Signed-off-by: NeilBrown <neilb@suse.de>
* | Fix udev-rules for case where array isn't really there..NeilBrown2009-03-091-0/+1
| | | | | | | | | | | | See http://git.kernel.org/?p=linux/hotplug/udev.git;a=commitdiff;h=b822542608326092e177fd1707ca7fb53b2846c4 Signed-off-by: NeilBrown <neilb@suse.de>
* | imsm: display supported chunk sizes in --detail-platformDan Williams2009-02-271-0/+17
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Incremental: honor --no-degraded to delay assemblyDan Williams2009-02-243-1/+10
| | | | | | | | | | | | | | | | | | | | Currently Incremental_container is being called after adding each disk. In the imsm case where spares are not tracked in the raid_disks field we can use --no-degraded to block premature assembly. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Incremental: fix 'name_to_use' in the container caseDan Williams2009-02-241-2/+9
| | | | | | | | | | | | | | | | | | Just like the Assemble case, default to the text_version of the container if another name is not specified. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: update cmdline when scanningDan Williams2009-02-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | Allows ps -ax | grep mdmon to show: mdmon md127 mdmon md126 ...rather than: mdmon /proc/mdstat mdmon /proc/mdstat Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: man pageDan Williams2009-02-241-0/+138
| | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: fix missed 'clean' eventDan Williams2009-02-241-28/+21
| | | | | | | | | | | | | | | | | | | | | | | | mdmon may miss events because it re-reads state after read_and_act. The additional read is used to determine dirty status before allowing a sigterm to proceed. Since read_and_act is in the best position to determine 'dirty' status and its return value is not used, modify it to return true if the array is dirty. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: auto layoutDan Williams2009-02-241-7/+103
| | | | | | | | | | | | | | | | | | | | | | | | In support of auto-layout: 1/ collect and merge all extents to find the largest common-start free region 2/ verify that we meet the "all volumes must use the same set of disks" 2/ mark the disks to be added in add_to_super_imsm_volume Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Create: fixup 'insert_point', dependent on 'subdevs', for auto-layoutDan Williams2009-02-241-1/+5
| | | | | | | | | | | | | | | | | | 'subdevs' is read from the container in the auto-layout case so reset subdevs dependent default values. 'insert_point' without this change is always 2 blocking creation of arrays with > 2 raid disks. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Create: wait_for container creationDan Williams2009-02-241-0/+1
| | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Manage: permit '--remove detached' for containersDan Williams2009-02-241-1/+8
| | | | | | | | | | | | | | | | Skip the unique holder check in the detached case... pretty sure no one is holding on to it if open() returns ENXIO. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: record added disksDan Williams2009-02-241-2/+13
| | | | | | | | | | | | | | Prevent duplicate disks from being sent to the monitor thread. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: fix removed disk handlingDan Williams2009-02-242-8/+11
| | | | | | | | | | | | | | | | Use SKIP_GONE_DEVS when reading the container, and correct some confused logic in manage_new(). Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | sysfs: allow sysfs_read to detect and drop removed disksDan Williams2009-02-244-24/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All operations that rely on loading from an existing container (like --add) will fail after a disk has been removed. Provide an option to skip missing / offline disks rather than abort. We attempt to do this in the load_super_{imsm,ddf}_all cases when mdmon is running i.e. we already have a consitent version of the metadata running in the system. Otherwise, we fail as normal and let the administrator fix up the container. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: retry load_imsm_mpb if we suspect mdmon has made modificationsDan Williams2009-02-241-3/+14
| | | | | | | | | | | | | | | | | | | | If the checksum verification fails and mdmon is running we retry the load to get a consistent snapshot of the mpb. Found by tests/08imsm-overlap. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: verify single sector mpb checksumsDan Williams2009-02-241-0/+11
| | | | | | | | | | | | | | If the mpb is only one sector do not skip the checksum verification. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix mark_failure / introduce mark_missingDan Williams2009-02-241-19/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Actually, rename mark_failure to mark_missing and then implement the correct mark_failure which according to new documentation is to: 1/ Set the FAILED status bit 2/ Set IMSM_ORD_REBUILD to mark the disk out of sync 3/ Set map->failed_disk_num if this is the first failure detected failure (it is ~0 otherwise) Previously the assumption was that IMSM_ORD_REBUILD only appeared in map[1], so all routines that care about out-of-sync disks need to be updated. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: introduce get_imsm_disk_slotDan Williams2009-02-241-27/+29
| | | | | | | | | | | | | | | | | | Implement a common disk index to disk slot routine and replace open coded versions. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix activate spare to ignore foreign disksDan Williams2009-02-231-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | A foreign disk is one that all other drives believe is not-in-sync but does not have the 'failed' status bit set. This also reverts, because that commit is addressing the wrong problem. Ideally mdmon would kick "non-fresh" drives like the kernel does at native-md activation time, but that is too awkward to implement at the moment because mdadm owns container manipulations. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fixup container spare uuids by defaultDan Williams2009-02-231-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | Spares in the imsm case are marked with the "match-all" uuid of ffffffff-ffffffff-ffffffff-ffffffff. When performing incremental assembly we need to associate such devices with a populated container uuid. Also when performing --detail on a container with only spares present we can make an attempt to return a real uuid. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix missing initializations of the per-disk extents pointerDan Williams2009-02-231-0/+2
| | | | | | | | | | | | | | | | Fixes a glibc assertion when trying to free a pointer that was not malloc'd. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | test: fix a call to udevsettleDan Williams2009-02-231-1/+1
| | | | | | | | | | | | | | udevsettle is deprecated, use udevadm settle Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: provide a simulated option-rom for regression testsDan Williams2009-02-235-5/+175
| | | | | | | | | | | | | | | | | | | | | | IMSM_NO_PLATFORM turns off checks that should be tested, so provide a IMSM_TEST_OROM variable to allow testing the orom constraints in the mdadm regression suite. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: block creation of devices with identical namesDan Williams2009-02-021-0/+11
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: don't check raid1 chunk sizeDan Williams2009-02-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | mdadm -C /dev/md/r1d2n1s0-5 -amd -l1 --size 5242880 -n 2 /dev/sdb /dev/sdc -R -f -v -c 64 mdadm: chunk size ignored for this level mdadm: super0.90 cannot open /dev/sdb: Device or resource busy mdadm: super1.x cannot open /dev/sdb: Device or resource busy mdadm: platform does not support a chunk size of: 0 mdadm: device /dev/sdb not suitable for any style of array Reported-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Tested-by: Jacek Danecki <jacek.danecki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Merge branch 'master' into devel-3.0NeilBrown2009-02-026-10/+11
|\|
| * Fix possible crash if bitmap metadata is bad.NeilBrown2009-02-021-1/+1
| | | | | | | | | | | | | | | | | | We really should never divide by 0. Thanks to "Jon Nelson" <jnelson-linux-raid@jamponi.net> for finding the problem. Signed-off-by: NeilBrown <neilb@suse.de>
| * Document 'max' option to --grow --size in --help output.NeilBrown2009-02-021-1/+2
| | | | | | | | | | | | Suggestion from Christian Hudon <chrish@debian.org> Signed-off-by: NeilBrown <neilb@suse.de>
| * Typo in earlier patch : asprintf -> vasprintfDustin Kirkland2009-02-021-1/+1
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
| * 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>
| * mdadm fix compilation for uClibcBernhard Reutner-Fischer2009-02-023-5/+5
| | | | | | | | | | | | | | | | | | | | | | 2008-12-08 Bernhard Reutner-Fischer <rep.dot.nop@gmail.com> * Makefile (dadm.uclibc): Remove misspelled and unneeded rule. * md5.h: Include stdint.h for uClibc. * mdadm.h: uClibc defines __UCLIBC__. If uClibc has LFS off then use lseek instead of lseek64. Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
* | imsm: fix failed disks are allowed back into the containerDan Williams2009-01-231-1/+4
| | | | | | | | | | | | | | | | | | Failed disks do not have valid serial numbers which means we will not pick up the 'failed' status bit from the metadata entry. Check for dl->index == -2 to prevent failed disks from being incorporated into the container. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Create: warn when a metadata format's platform components are missingDan Williams2009-01-204-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | imsm: enforce "all member disks must be members of all arrays"Dan Williams2009-01-201-29/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a key orom-compatibility constraint. A nice side effect is that it precludes the corner case of 'create' racing against 'spare activate' since the create will fail to convert a spare into an array member. At create time we check if this is the first member array in the container if it is than all disks are possible candidates, if it is not then only current members are permitted. A bit hairier is spare-activation handling in the presence of this constraint. It is difficult because spare handling is per array. The approach taken is to: 1/ check that a new spare can cover all defined arrays in the container 2/ ensure that partially assimilated spares are the first candidates when looking for a spare region to activate. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: enforce num_disks constraintsDan Williams2009-01-201-5/+5
| | | | | | | | | | | | | | | | | | | | RAID1 == 2 disks RAID5 >= 3 disks RAID10 == 4 disks Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: rename vprintf macro to pr_vrbDan Williams2009-01-201-6/+6
| | | | | | | | | | | | | | | | Don't redefine standard library calls unecessarily... Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Create: allow per-metadata default layoutsDan Williams2009-01-203-26/+52
| | | | | | | | | | | | | | | | Let handlers specifiy their own defaults, specifically needed for the imsm-raid5 case where mdadm defaults to 'ls' and imsm to 'la'. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: make switchroot an undecorated optionDan Williams2009-01-201-9/+5
| | | | | | | | | | | | | | | | | | | | Simplify the usage from: mdmon [--switch-root dir] /device/name/for/container to... mdmon /device/name/for/container [target_dir] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Assemble: fix busy detectionDan Williams2009-01-201-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use mddev_busy() as GET_ARRAY_INFO can succeed on 'clear' arrays. Ran into this after an encountering a case where mdadm -Ss ended in segfault (missing check for NULL return from map_by_devnum() in sles11:Manage.c). So, tried to stop the array by hand with echo clear > md/array_state, after which I could not reassemble since GET_ARRAY_INFO was succeeding. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: support scanning for containersDan Williams2009-01-201-22/+49
| | | | | | | | | | | | | | | | When the given container is '/proc/mdstat' then launch an mdmon instance per container found in /proc/mdstat. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: expand permissible container device namesDan Williams2009-01-201-3/+18
| | | | | | | | | | | | | | | | Allow any path that dereferences to an md device to be used in addition to the current symbolic md device names. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: imsm_read_serial check for zero-length responseDan Williams2009-01-201-0/+7
| | | | | | | | | | | | VMWare virtual disks successfully run the inquiry but return a zero response. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix dev_open return value handlingDan Williams2009-01-201-3/+3
| | | | | | | | | | | | dev_open returns an fd Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: fix missing ->subarray initializationDan Williams2009-01-131-0/+1
| | | | | | | | | | | | This can cause mdmon to fail at startup. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Merge branch 'master' into scratch-3.0NeilBrown2009-01-085-2/+16
|\| | | | | | | | | | | | | Conflicts: Assemble.c config.c