summaryrefslogtreecommitdiff
path: root/super-intel.c
Commit message (Collapse)AuthorAge
* imsm: FIX: Store checkpoint in per disk unitsAdam Kwolek2011-03-14
| | | | | | | | | | While last_checkpoint is counter in per disk units, checkpoints should be stored in the same manner. Restoring from checkpoint should should recalculate checkpoint in to array position (reshape_progress). Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Make find_intel_hba_capability less verbose.NeilBrown2011-03-10
| | | | | | | | | | | mdadm has a convention in some areas of passing a device name if error messages about it are interesting, or NULL if not. Follow this convention with find_intel_hba_capability so that it doesn't complain when not appropriate - and so that it doesn't have to go and find a device name that it wasn't given. Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: introduce SAS controller support in imsm metadata handlerLabun, Marcin2011-03-10
| | | | | | | | | | | OROM/EFI capabilities are retrieved based on disk's controller type. 1/ alloc_super no longer retrieves OROM capabilities 2/ find_imsm_capability replaces find_imsm_orom 3/ new function find_intel_hba_capability gets disk's HBA and relevant capability Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: move code for retrieving HBA to a functionLabun, Marcin2011-03-10
| | | | | | | | Function find_intel_hba_capability attaches HBA information to intel_super structure based on fd of the component disk. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: verify that component disks are attached to the same type of HBALabun, Marcin2011-03-10
| | | | | | | | | compare_super_imsm verifies that the component disks use the same type of HBA in platform dependent environment. Otherwise print-out error message and block the action. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: add maximum number of disk validation in RAID arrayLabun, Marcin2011-03-10
| | | | | | | | Arrays exceeding the OROM/EFI maximum number of supported disk are blocked in validate_geometry_imsm_orom function. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: print-out error message when volume validation failsLabun, Marcin2011-03-10
| | | | | | | | Print-out error message when volume geometry fails to comply with OROM/EFI controller's capabilities. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: do not publish OROM/EFI unsupported arraysLabun, Marcin2011-03-10
| | | | | | | | Container_content_imsm calls validate_goemtry_imsm_orom to verify that the array parameters are supported by controller's OROM/EFI. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: detail_platform_imsm displays AHCI and SAS controller informationLabun, Marcin2011-03-10
| | | | | | | | The function uses find_intel_device and find_imsm_capability to present AHCI and SAS controller capabilities taken from OROM or EFI. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: remove unused parameters in function attach_hba_to_superLabun, Marcin2011-03-10
| | | | | Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm : FIX: Assemble dirty array when reshape is in progressAdam Kwolek2011-03-10
| | | | | | | | | | | | During reshape for dirty volumes reshape_progress has to be calculated also. To keep the same logic for array creation: not setting info->resync_start = MaxSector when first condition is true, resync_start is initialized by MaxSector to allow proper array initialization. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: Mark checkpoint and array state clean during reshapeAdam Kwolek2011-03-09
| | | | | | | | | | Array state has to be managed during reshape based on consistent flag. To achieve this existing code will be reused. Currently existing code for blocks_per_unit calculation can be removed and existing code can be reused also. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Allow Grow_continue for whole container as well as single array.NeilBrown2011-03-08
| | | | | | | | | | | | | | Some grow operations must be applied to a whole container. These are performed one array at a time, so only one array appears to be reshaping. When re-assembling such an array, we need to make sure that when the reshape finished, we move on to the next array. So require metadata to set ->reshape_active = 2 in that case, and use reshape_container to complete the reshape. Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: Variables declaration cleanupAdam Kwolek2011-03-08
| | | | | | | | Variables declaration moved a little bit up, to not mix declaration and code. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: Return blocks_per unit for general migrationAdam Kwolek2011-03-08
| | | | | | | | For general migration, blocks per unit are required for all disks, not for per-member. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: improve getinfo_super when reshape is in progress.NeilBrown2011-03-08
| | | | | | | | | | | | | | If a reshape (migration) is happening, we might need to modify the information with provide to md so that it can cope with the reshape. For example, if a migration from 4-device RAID0 to 5-device RAID0 is happening, we need to tell md that it is reshape from degraded 5-device RAID4 to degraded 6-device RAID4 so md doesn't handle direct reshape of RAID0. There may be other migrations supported by IMSM that need special treatment here. Signed-off-by: NeilBrown <neilb@suse.de>
* Enable error message in case of lack of spares for growKrzysztof Wojcik2011-03-08
| | | | | | | | | When we cannot find spare devices for grow operation we should print error message. This patch changes debug error message to 'stderr' print. Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* FIX: imsm: OROM does not recognize degraded arrays (V2)Krzysztof Wojcik2011-02-27
| | | | | | | | | | | | | | | | | | | | | | | | Defect description: When we create an redundant array in mdadm and then degrade it by disk removing, Option ROM and Windows OS does not detect any array. Reason: Metadata created and updated after degrading array is not compatible with IMSM standard. This patch synchronizes the metadata according IMSM requirements. Following inconsistencies have been fixed: - reset all fields in imsm_dev during creation to avoid random values - init dev status during creation to proper state - not reset CONFIGURED_DISK flag when disk is missing - add ":0" suffix to the serial number for missing/failed disks - update medatada signature after takeover operation - mark map state as degraded after raid0->raid10 takeover Note: Patch reworked after Dan Willams review. Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: Report correct array size during reshapeAdam Kwolek2011-02-23
| | | | | | | | | | | When reshape is started imsm stores new size in metadata. mdadm requires "old" size to proper initialization restarted array. When reshape is in progress getinfo_super_imsm_volume() should report computed array size value instead array size stored in metatda. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: initalize reshape progress as it is stored in metatdataAdam Kwolek2011-02-23
| | | | | | | | | | | | reshape prodess cannot be restarted due to no checkpoint information in mdinfo. When metadata is read during reshape process or reshape restart, rehape_progress (mdinfo field) has to be initialized to value stored in metadata. This allows start reshape from stored in metadata checkpoint. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> 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>
* imsm: FIX: Add spare disks information to array descriptionAdam Kwolek2011-02-14
| | | | | | | | | | Spares that are specified on container can be used by any array in container. this means that for every array in container they should be reported. This let caller know how many spare devices (not used in any array) are still available. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* FIX: delta_disk can have UnSet valueAdam Kwolek2011-02-14
| | | | | | | | | | | | Delta_disk can be set to UnSet value. This can a cause to pass wrong parameter to reshape_super(). To avoid such situations raid_disks and delta_disks parameters have to be passed to reshape_super() separately. It will be up to reshape_super() function validation and usage of this parameters to avoid not valid values. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* fix: imsm: assemble doesn't restart recoveryCzarnowska, Anna2011-02-14
| | | | | | | Because IMSM_ORD_REBUILD is set in second map not first. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* fix: imsm: size must be in K for rounding to chunkCzarnowska, Anna2011-02-14
| | | | | | | | | chunk is in K so size must be converted to K before it is rounded. Otherwise we may get wrong freesize returned resulting in creation failure. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: Add information about failed disk to '-E' optionAdam Kwolek2011-02-14
| | | | | | | | | During metadata printout in '-E' option failed disk map field information is missing. Add this information to mdadm '-E' option output. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: Use single migration type for all migrationsAdam Kwolek2011-02-14
| | | | | | | | | | | | | | Use single enum definition/migration type for all migrations. Using separate definitions causes limitation for number of changes in metadata implementation during single update for migration/reshape. Single CH_MIGRATION enum allows for many mtadata parameters change in single update. It will be possible to change i.e. chunk size together with raid level. In current implementation 2 metadata updates would be required for such action, one using CH_CHUNK_MIGR and second using CH_LEVEL_MIGRATION migration type. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: add raid5 to raid0 case to analyse_change()Adam Kwolek2011-02-14
| | | | | | | | | Transition raid0 to raid5 is not possible due to wrong condition in imsm_analyze_change(). Current condition blocks migration possibility instead allow for it. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: Wrong output string formatAdam Kwolek2011-02-09
| | | | | | | | | | | On wrong starting container reshape conditions, mdadm returns information on console: mdadmimsm: Operation is not allowed on this container it is changed to: mdadm: (imsm) Operation is not allowed on this container Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* fix: array is reassembled inactive if stopped during resyncCzarnowska, Anna2011-02-08
| | | | | | | | | | | | | | | If initial resync or recovery of a redundant array is not finished before it is stopped then during assembly md will start it as inactive. Writing readonly to array_state in assemble_container_content fails because md thinks the array is during reshape. In fact we only have a reshape if both current and previous map states are the same. Otherwise we may have resync or recovery. Setting reshape_active in such cases causes the issue. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: Size is already set in metadataAdam Kwolek2011-02-03
| | | | | | | | In metadata size is set already during migration initialization. There is no reason for second /the same/ calculation. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: size have to be calculated based on first mapAdam Kwolek2011-02-03
| | | | | | | | | | | | | Before reshape finalization migration is still present in metadata. After patch 'imsm: FIX: crash during getting map' function get_imsm_map() returns correct value, this means in our case from second (start) map. We should calculate map size basing on first (final) map. For this we should request it by setting second function parameter to '0' Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: move common code for array size calculation to functionAdam Kwolek2011-02-03
| | | | | | | | Array size calculation is made in the same way in few places in code. Make function imsm_set_device_size() for this common code. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: Debug strings cleanupAdam Kwolek2011-02-03
| | | | | | | | | | Some debug strings remains as they were introduced, before code was moved to separate function. Information displayed by debug information in not all cases was correct. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: fix: imsm_num_data_members() can return errorAdam Kwolek2011-02-03
| | | | | | | | imsm_num_data_members() can indicate error by returning 0 value In such case size cannot be set based on 0 value. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: put expansion finalization in to one placeAdam Kwolek2011-02-03
| | | | | | | | | | | | When a->last_checkpoint variable can reach array end, reshape finalization can be put in to single place. There is no need to reset migration variables. imsm_set_disk() will call end_migration() and this sets all migration variables to required values. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: crash during getting mapAdam Kwolek2011-02-03
| | | | | | | | | | | | | When get_imsm_map() is called with second_map parameter == '-1' and array is not in migration state NULL pointer is returned. This is wrong. '-1' means return map as migration record points. '-1' can be passed to get_imsm_map() from imsm_num_data_members(). imsm_num_data_members() is called to get current map members based on migr_state information Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Various compile fixes.NeilBrown2011-02-01
| | | | | | | Make "make everything" succeed. This fixed some real bugs. Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: map coping causes mdmon crashAdam Kwolek2011-02-01
| | | | | | | | | | Too big map was copied (outside allocated memory) and this causes mdmon crash for 2 raid0 arrays in container. Map of correct (smaller) size should be copied, to not overwrite any internal data. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: mdmon crash during 2 raid0 arrays expansionAdam Kwolek2011-02-01
| | | | | | | | | | | | | | | | | When expansion is run on 2 raid0 arrays in container no update is sent to mdmon because mdmon is off (mdadm performs update) Memory size for first reshaped array is allocated to satisfy memory requirements for expanded maps. Memory for second device is allocated using old disks number, as in metadata there is no information about this array reshape. When mdmon initiates second array reshape it overwrites internal structures and crashes). There is no place to keep expanded maps. To avoid this situation during loading metadata, allocated memory should be performed using the maximum used disks number in particular container. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: Update metadata for second arrayAdam Kwolek2011-02-01
| | | | | | | | | When second array reshape is about to start external metadata should be updated by mdmon in imsm_set_array_state(). For this purposes imsm_progress_container_reshape() is reused. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm:FIX: change arrays reshape orderAdam Kwolek2011-02-01
| | | | | | | | | | Reshape is started from second array, so it causes imsm incompatibility and problems during second array start. Reshape should be started in arrays metadata order. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: not all disks are released in free_imsm_disks()Adam Kwolek2011-01-31
| | | | | | | | | | | | | | | Adding spare disks to imsm container fails due to problem with writing new_dev to sysfs. This problem was caused by not closed handle (opened exclusively) in Manage.c:803. Disk handle was not closed by free_imsm(). This is due to not released disk_mgmt_list in free_imsm_disks(). Proper release of imsm metadata allows for spare adding without problems. Memory leak was fixed also. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: do not allow for container operation for the same disks numberAdam Kwolek2011-01-28
| | | | | | | | | | | imsm_reshape_super() currently allows for expansion when requested raid_disks number is the same as current. This is wrong. Existing in code condition is too weak. We should allow for expansion when new disks_number is greater than current only. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Add raid1->raid0 takeover supportKrzysztof Wojcik2011-01-27
| | | | | | | | Add support for raid1 to raid0 takeover operation in user space. This patch includes support for native and imsm metadata. Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: support for Intel SAS controller in get_disk_controller_domain handlerLabun Marcin2011-01-26
| | | | | | | | | | get_disk_controller_domain recognizes Intel (R) SAS controller (isci). The function returns three different strings that differentiate disk attached to AHCI, ISCI or unknown controller types to create separate domains for each case. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: detail_platform_imsm supports Intel SAS controller (isci driver)Labun Marcin2011-01-26
| | | | | | | | | | Added support in detail_platform_imsm for Intel (R) SAS controller. Function supports AHCI and ISCI controllers. RAID properties are derived from common OROM for both types. Based on code From: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: prepare detail_platform_imsm to support different types of controllersLabun Marcin2011-01-26
| | | | | | | | | Pull out the AHCI specific parts of detail_platform_imsm to separate functions. Introduce support new types of controllers. Based on code From: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: support for Intel(R) SAS controller in imsm handlerLabun Marcin2011-01-26
| | | | | | | | | | | | | add_to_super_imsm handler is able to recognize new type of controller. It stores the controller information in its structures and blocks mixing of different controller type in the same container. In this way it maintains compatibility between Linux and Windows IMSM RAID stacks. IMSM metadata does not allow arrays to span on devices attached to different storage controllers. Based on code From: Artur Wojcik <artur.wojcik@intel.com> Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Check number of failed disks durig raid10->raid0 takeoverKrzysztof Wojcik2011-01-26
| | | | | | | | | Number of failed disks MUST be half of initial number of disks. If number of failed disks is different we should not update metadata- data corruption may occur after array reassemlation. Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>