summaryrefslogtreecommitdiffstats
path: root/super-intel.c
Commit message (Collapse)AuthorAgeFilesLines
* 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-081-0/+1
| | | | | | | 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-081-10/+89
| | | | | | | | | | | | | | | 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: 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>
* imsm: fix metadata reservationDan Williams2008-11-271-0/+7
| | | | | | | | | | 1/ When truncating the space reserved for the metadata round down to an even numbered sector count to avoid an off-by-one error when sysfs_add_disk rounds up. 2/ Set the current metadata parameter block size as a floor. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Tidy error messages for add_to_super failure.NeilBrown2008-11-271-1/+9
| | | | | | | Make sure every failure from add_to_super prints a suitable error message, and then don't print any error in the caller. Signed-off-by: NeilBrown <neilb@suse.de>
* allow add_to_super to return errorsDan Williams2008-11-271-8/+10
| | | | | | Prepare add_to_super to validate disks against the platform capabilities Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: fix uuid_from_super given 'signature' is not constantDan Williams2008-11-081-1/+1
| | | | | | | The version portion of the signature changes depending on the contents of the container. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: compatibility fixes for creating imsm arraysDan Williams2008-11-081-5/+64
| | | | | | | When creating an imsm array use the lowest possible feature set to maximize compatibility. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: fixup disk status definition endianessDan Williams2008-11-081-51/+27
| | | | | | | Change the multibyte disk status field definitions to imsm byte-order (little-endian) to match other multibyte field definitions. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: add definitions for recent imsm versionsDan Williams2008-11-081-8/+48
| | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: cleanup migration definitions and usageDan Williams2008-11-071-12/+18
| | | | | | imsm_set_array_state need not look at the map_state when failed==0 Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: cleanup ->match_home and comment on return valueDan Williams2008-11-071-1/+8
| | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* A couple of bugfixes found by suse autobuilding:NeilBrown2008-11-071-2/+4
| | | | | | | 1/ ia64 appear to have __clone2, not clone. 2/ Including "++" in the arg to a macro is a bad thing to do. Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: display container uuid in detail_superDan Williams2008-11-041-1/+6
| | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: display member array uuid in examine_super_imsmDan Williams2008-11-041-9/+16
| | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Don't give array name in --examine --brief output if it is doubtful.NeilBrown2008-11-041-4/+5
| | | | | Now that mdadm.conf doesn't need an array name, we don't need to give one if the array cannot reliably provide one.
* util: make env checking more genericNeilBrown2008-11-041-12/+1
| | | | | | | Change the "env_check_mdmon" function to be more generic, accepting and environment variable name, as soon we will have a new use for it. Signed-off-by: NeilBrown <neilb@suse.de>
* intel: Avoid 'may be used before initialised' warning.NeilBrown2008-11-041-1/+2
| | | | | When compile with -Os, the compile doesn't work out that the variable is always initialised before usage, so we tell it.
* imsm: include members in ->brief_examineDan Williams2008-10-281-1/+15
| | | | A prerquisite for getting imsm arrays assembled by mdadm -As.
* imsm: copy raid device info when associating sparesDan Williams2008-10-281-0/+18
| | | | | | | If a spare is included in the list of examined disks we need to copy in at least enough information to get the uuid of the populated container. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: return associated uuid for sparesDan Williams2008-10-281-1/+5
| | | | | | | This prevents a uuid of all f's from being displayed when an imsm spare is listed along with active disks for mdadm -Eb. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Examine: fix MD_DISK_SYNC is a bit not a flagDan Williams2008-10-281-7/+4
| | | | | | | Examine() is actually looking at the ACTIVE bit. This happened to work for imsm spares but now it needs to be fixed up. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: update metadata immediately on "add spare" eventsDan Williams2008-10-281-0/+2
| | | | | | | ...without this the spare record is delayed until the next metadata event. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* update copyright headersDan Williams2008-10-281-1/+1
| | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Treat all devices at the container level as sparesDan Williams2008-10-151-2/+0
| | | | | | | | | Raid disk and disk number information is not relevant at the container level, especially for imsm. So arrange for getinfo_super_imsm() to always publish devices as spares and report the number of spares at Assemble() time. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Allow a uuid of all f's to always matchDan Williams2008-10-151-1/+7
| | | | | | | The uuid returned for an imsm spare device will never match the uuid of an active disk. So make mdadm interpret a uuid of all f's as "match any". Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: show uuid in ->examine_super()Dan Williams2008-10-151-3/+10
| | | | | | ...and add "auto=md" to the brief output. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* non-trivial warn_unused_result fixes, activate_spareDan Williams2008-10-151-1/+19
| | | | | | | Both super-ddf and super-intel ignore memory allocation failures during ->activate_spare. Fix these up by cancelling the activation. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: determine failed indexes from the most up-to-date diskDan Williams2008-10-151-0/+7
| | | | | | | | load_imsm_disk() currently notices if spares missed their activation update, but we allow a stale failed disk back in to the array because its serial number is clobbered in the most up-to-date disk. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: manage a list of missing disksDan Williams2008-10-151-9/+98
| | | | | | | | | If a drive is removed while mdmon is not running we need a way to identify what is missing and mark that disk as failed in the metadata. At ->load_super() time create a list of missing disks defined as a disk that is marked in-sync yet does not appear in super->disks. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: fix mpb_size calculation in write_super_imsmDan Williams2008-10-151-3/+2
| | | | | | | Spotted a thinko... raid devices are dynamically sized, disks are not. The space for disks is always mpb->num_disks * sizeof(struct imsm_disk). Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: enable checkpointing of migration (resync/rebuild)Dan Williams2008-10-151-9/+27
| | | | | | | | When the array is shutdown, or when mdadm --wait-clean is called, any active resync process will be idled allowing mdmon to record the current resync position. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* monitor: protect against CONFIG_LBD=nDan Williams2008-10-151-2/+2
| | | | | | | | md/resync_start reports different terminal values depending on kernel configuration (~0UL versus ~0ULL). Make detection of the resync-complete state more robust by comparing against array size. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: trust sector reservation from metadataDan Williams2008-10-151-11/+57
| | | | | | | | On ich6r the option-rom appears to reserve only 432 sectors rather than the 418+4096 of newer implementations. For compatibility trust the metadata in these cases. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: confirm raid10 layout, fix up handling raid10 failuresDan Williams2008-10-151-18/+23
| | | | | | | | 1/ near-2 indeed matches how the Windows driver lays out the data 2/ update imsm_check_degraded to check for rebuilding disks in the raid10 case Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* imsm: more serial handling fixupsDan Williams2008-10-151-1/+8
| | | | | | | | zero-initialize the serial buffer to handle cases where the response is less than MAX_RAID_SERIAL_LEN. Tested-by: Jacek Danecki <jacek.danecki@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Report uuid in --detail --brief for ddf and intelNeilBrown2008-09-181-2/+15
| | | | The uuid is slightly fictitious but needed for array matching.
* Add uuid support for super-intel.NeilBrown2008-09-181-5/+42
| | | | | 'imsm' does not provide any real uuid, so we synthesise one from various stable bits of the superblock.
* Allow metadata handler to report that it doesn't record homehost.NeilBrown2008-09-181-1/+1
| | | | | | | For now, this means that the lack of a homehost doesn't always prevent assembly. Soon we will allow assembly anyway, but have different messages if homehost isn't supported.
* Lots of fixes to make incremental assembly of containers work.NeilBrown2008-09-181-0/+1
| | | | | | | | So: mdadm -I /dev/whatever will (if appropriate) add whatever to a container, then start any arrays inside the container.
* Handle incremental assembly of containers.NeilBrown2008-09-181-0/+2
| | | | | | | | | mdadm -I /dev/part-of-container should add that to a container, creating if it needed, and then try to assemble any arrays in the container. Signed-off-by: NeilBrown <neilb@suse.de>
* Move calls to SET_ARRAY_INFO to common helper.NeilBrown2008-09-181-0/+4
| | | | | | | | | | When we assemble an array, there are three different approaches depending on whether metadata is internal or external, and on kernel version. Move all this to a common helper instead of duplicating in 3 places. Signed-off-by: NeilBrown <neilb@suse.de>
* Factor out add-disk codeNeilBrown2008-09-181-2/+2
| | | | | | | | | | | | | The variety of approaches to 'add_disk' are factored out into a separate function, and Incremental mode benefits by being closer to supporting the assembly of containers. Also remove the adding-to-array-data-structure out of sysfs_add_disk and into add_disk. And add some tests for --incremental mode to make sure we don't break it. Signed-off-by: NeilBrown <neilb@suse.de>
* Compile fixes, particularly moving more stuff under MDASSEMBLENeilBrown2008-09-181-8/+23
| | | | Now 'make everything' works again.