summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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
| * Fail overtly when asprintf fails to allocate memoryDustin Kirkland2009-01-083-3/+14
| | | | | | | | | | | | .. rather that causing a less-obvious violation of segments. Signed-off-by: NeilBrown <neilb@suse.de>
| * Free mdstat data structures properly.NeilBrown2009-01-083-1/+4
| | | | | | | | | | | | | | In one case we called 'free' instead of 'mdstat_free'. In others we didn't free at all. Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'devel' of ↵NeilBrown2008-12-1820-118/+1620
|\ \ | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/djbw/mdadm into devel-3.0
| * | imsm: test overlapping createsDan Williams2008-12-083-0/+94
| | | | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | workaround a hald interaction and quiet cleanupDan Williams2008-12-081-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | The 'udevadm settle' call appears to resolve: mdadm: failed to stop array /dev/md127: Device or resource busy Perhaps a running process, mounted filesystem or active volume group? Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | test: enable per-test custom environment setup/teardownDan Williams2008-12-081-0/+18
| | | | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: don't take chunk_size into account for raid1Dan Williams2008-12-081-1/+4
| | | | | | | | | | | | | | | | | | Results in chopping off usable parts of the requested size. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: reverse swapped arguments to posix_memalign in imsm_prepare_updateDan Williams2008-12-081-1/+1
| | | | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: convert dev_tbl to devlistDan Williams2008-12-081-37/+108
| | | | | | | | | | | | | | | | | | | | | ...to facilitate testing arbitrary numbers of raid devices Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: provide a detail_platform methodDan Williams2008-12-081-0/+248
| | | | | | | | | | | | | | | | | | | | | | | | | | | Dump the orom capabilities and hardware disk configuration. This code relies on the name of scsi_host objects to determine the hardware port number. Hopefully this information is stable... Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | introduce --detail-platform to display platform raid capabilitiesDan Williams2008-12-089-3/+89
| | | | | | | | | | | | | | | | | | | | | 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>
| * | imsm: validate arrays being created against firmware capabilitiesDan Williams2008-12-083-14/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These checks are only enabled when platform support for imsm is found, i.e. ahci driver is loaded and talking to an Intel(R) controller, and the option rom header is located. They can be turned off by setting the environment variable IMSM_NO_PLATFORM to 1. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: sysfs support routines for determining device connectivityDan Williams2008-12-082-0/+64
| | | | | | | | | | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: detect option-rom capabilitiesDan Williams2008-12-082-0/+267
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The option-rom advertises its capabilities in a data structure located in the platform ROM region 0xc0000-0xf0000. Attempt to detect the option-rom and limit array creation to the platform's capabilities. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | port arch/x86/kernel/probe_roms_32.c for use in 'platform' supportDan Williams2008-12-082-0/+303
| | | | | | | | | | | | | | | | | | | | | | | | | | | This provides at least a kernel bug compatible method of scanning for an adapter-rom. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: pass disk info in create messageDan Williams2008-12-081-37/+111
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We may be creating on spare disks in which case we need to know which disk goes in which slot. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: correct start offset handling at create timeDan Williams2008-12-081-22/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | imsm metadata requires all members of a raid volume to start at the same offset. So, incrementally build a composite disk from all the candidates passed to ->validate_geometry. After each disk is added merge the extents and search for a common start offset that satisfies the requested raid device size. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: fix setting of device size for raid1Dan Williams2008-12-081-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | When chunksize is 0 in the raid1 case we need to use info_to_blocks_per_member() to calculate the array size. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | wait_for container assemblyDan Williams2008-12-081-0/+1
| | | | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | fix ->metadata_version checking in Wait()Dan Williams2008-12-021-1/+1
| | | | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>