summaryrefslogtreecommitdiff
path: root/super-ddf.c
Commit message (Collapse)AuthorAge
* ddf: fix up getinfo_super_bvdNeilBrown2011-06-15
| | | | | | | Now that getinfo_super clears the info structure, we need to make sure the correct values are filled in to info->dev. Signed-off-by: NeilBrown <neilb@suse.de>
* Fix some fall-out from recent memset-zero for getinfo_superNeilBrown2011-06-09
| | | | | | | | | | | container_content_imsm was setting info->next before calling getinfo_super_imsm_container which now zeros everything. So move that assignment to afterwards. So both imsm and ddf were assuming info->disk.raid_disk means something but it doesn't. So fix those. Signed-off-by: NeilBrown <neilb@suse.de>
* getinfo_super now clears the 'info' structure before filling it in.NeilBrown2011-06-08
| | | | | | | | | | | | | | Some code currently clears 'info' before calling getinfo_super, some code doesn't. To be consistent, change it so no caller ever clears 'info', but ever getinfo_super function must clear it. Note that ->raid_disk may be meaningful if that 'map' is passed non-NULL. In that case it is copied out before the structure is zeroed. Signed-off-by: NeilBrown <neilb@suse.de>
* ddf: fix up detection of failed/missing devices.NeilBrown2011-03-22
| | | | | | | | If a device hasn't been found yet we can still tell if it is expected to be working, and we must to do to make sure 'working_disks' is correct. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'master' into devel-3.2NeilBrown2011-03-15
|\ | | | | | | | | | | | | | | Conflicts: Manage.c managemon.c super-ddf.c super-intel.c
| * ddf: implement remove_from_superNeilBrown2011-03-15
| | | | | | | | | | | | | | | | | | | | This is needed to remove devices from mdmon's knowledge when the device is removed from the md container. Now that ddf have a remove_from_super we don't need the code that allows some personalities not to implement this. Signed-off-by: NeilBrown <neilb@suse.de>
| * DDF Allow a RAID1 to be 'partially optimal'.NeilBrown2011-03-15
| | | | | | | | | | | | | | | | | | If a RAID1 is meant to have more than 2 device and while it doesn't have that many, it still has more than 1, then according to the DDF spec it is "partially optional" rather than "degraded" So make that so. Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: remove failed devices that are no longer in use.NeilBrown2011-03-15
| | | | | | | | | | | | | | | | | | | | The DDF spec requires we have a phys disk record for every physically attached device. But it isn't clear what that means in the case of soft raid in a general purpose Linux computer. So remove phys disk records for any failed device that is not active in any array. Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: set Rebuilding flag when adding devices to a degraded arrayNeilBrown2011-03-15
| | | | | | | | | | | | | | | | | | | | This is a big fragile, but DDF has wierd rules that we aren't really set up to handle properly. When we add a device to a degraded array it must be a spare, so mark it as Rebuilding. Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: use correct loop variable in activate_spareNeilBrown2011-03-15
| | | | | | | | | | | | | | Using 'i' when you mean 'j' just shows how silly it is to use variables named 'i' and 'j'. Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: Don't consider 'dl' entries with state_fd < 0NeilBrown2011-03-15
| | | | | | | | | | | | | | These have been marked as invalid (recently failed) so don't trust the major/minor associated with them. Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: implement remove_from_superNeilBrown2011-03-14
| | | | | | | | | | | | | | | | | | | | This is needed to remove devices from mdmon's knowledge when the device is removed from the md container. Now that ddf have a remove_from_super we don't need the code that allows some personalities not to implement this. Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: zero space_list in ddf_activate_spare.NeilBrown2011-03-14
| | | | | | | | | | | | Currently ->space_list is uninitialised here, which is obviously bad. Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' into devel-3.2NeilBrown2011-03-14
|\|
| * ddf: set vcnum correctly when creating a new virtual device in conflistNeilBrown2011-03-14
| | | | | | | | | | | | | | | | | | We weren't setting ->vcnum at all when an array was added. This meant that a subsequent device failure could be assigned to the wrong array. Reported-by: Albert Pauw <albert.pauw@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: teach set_disk to cope with new or changed devices.NeilBrown2011-03-14
| | | | | | | | | | | | | | When set_disk is called, we need to check if the disk has changed or recently appeared, and update everything properly if it has. Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: free_super should be add_list as well.NeilBrown2011-03-14
| | | | | | | | | | | | | | It is possible there is data and even an open file descriptor on 'add_list' - so it must be freed too. Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: minor activate_super fixes.NeilBrown2011-03-14
| | | | | | | | | | | | | | 1/ ignore devices with "state_fd < 0" as these have been removed. 2/ Set update 'length' properly and clear 'space'. Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: Failed should suppress Online and others.NeilBrown2011-03-10
| | | | | | | | | | | | so the notes say, so make it so. Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' into devel-3.2NeilBrown2011-03-10
|\| | | | | | | | | | | | | | | | | Conflicts: Grow.c Manage.c managemon.c mdadm.8.in util.c
| * ddf: remove duplicate container_member setting.NeilBrown2011-03-10
| | | | | | | | | | | | | | | | | | | | | | We were setting ->container_member twice in ddf get_info. Once to currentconf->vcnum, once to atoi(st->subarray). Both should be the same. For consistency with super-intel, use the first. Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: fail creation of new subarray with same name as old.NeilBrown2011-03-10
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: exclude failed devices from container_contentNeilBrown2011-03-03
| | | | | | | | | | | | | | | | If a device is failed, then don't include it in the reported container_content, else it might get included in the array. Reported-by: Albert Pauw <albert.pauw@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Fix chunksize defaulting.NeilBrown2011-03-09
| | | | | | | | | | | | | | | | | | the new code for defaulting chunksizes didn't work quite right - default was set to late in super1/super0/ddf - defaults would over-ride values of '0' imposed by some levels - default value wasn't applied to size properly. 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>
* | Don't close fds in write_init_superNeilBrown2011-01-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We previously closed all 'fds' associated with an array in write_init_super .. sometimes, and sometimes at bad times. This isn't neat and free_super is a better place to close them. So make sure free_super always closes the fds that the metadata manager kept hold of, and stop closing them in write_init_super. Also add a few more calls to free_super to make sure they really do get closed. Reported-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | load_super should not try to load_containerNeilBrown2011-01-12
| | | | | | | | | | | | | | Now that load_container is a separate operation, load_super should not try it first. Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: fail creation of new subarray with same name as old.NeilBrown2010-12-01
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: don't print warning on assembleNeilBrown2010-12-01
| | | | | | | | | | | | | | | | Now that we check the error return of 'update_super' better, we much make sure that ddf doesn't incorrectly report that the superblocks are wrong during assemble. Signed-off-by: NeilBrown <neilb@suse.de>
* | Create: cleanup/unify default geometry handlingDan Williams2010-11-23
| | | | | | | | | | | | | | | | Support metadata specific level, layout and chunksize defaults. Kill an uneeded superswitch methods ahead of adding more for the reshape case. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Remove loaded_containerNeilBrown2010-11-22
| | | | | | | | | | | | | | | | This field is now only set, never used. So remove it. Signed-off-by: NeilBrown <neilb@suse.de>
* | Use load_container in Incremental assembly.NeilBrown2010-11-22
| | | | | | | | | | | | | | | | | | We more clearly separate out -I on a container, and use load_container in that case and load_super only for true members. This removes another use of loaded_container. Signed-off-by: NeilBrown <neilb@suse.de>
* | New method: load_containerNeilBrown2010-11-22
| | | | | | | | | | | | | | | | This handles the 'container' part of 'load_super', so we can soon make them completely separate - it is just confusing to overload these two. Signed-off-by: NeilBrown <neilb@suse.de>
* | Remove keep_fd arg from load_super_XXX_allNeilBrown2010-11-22
| | | | | | | | | | | | It is always set to 1, so we don't need it. Signed-off-by: NeilBrown <neilb@suse.de>
* | Remove subarray field in supertype.NeilBrown2010-11-22
| | | | | | | | | | | | | | This is now only ever set, never used. So remove it. Signed-off-by: NeilBrown <neilb@suse.de>
* | Create: user container_dev rather than subarray for some tests.NeilBrown2010-11-22
| | | | | | | | | | | | | | | | | | It makes more sense to test for container_dev than for subarray for several places in Create where it then uses container_dev. This allows us to subsequently remove subarray. Signed-off-by: NeilBrown <neilb@suse.de>
* | Use container_member rather than subarray info ddf getinfo_super.NeilBrown2010-11-22
| | | | | | | | | | | | | | We are in the processes of discarding the subarray field, so remove the unnecessary use of it. Signed-off-by: NeilBrown <neilb@suse.de>
* | Remove subarray detection from load_super.NeilBrown2010-11-22
| | | | | | | | | | | | Nothing relies on this any more, so remove it. Signed-off-by: NeilBrown <neilb@suse.de>
* | Add subarray arg to container_content.NeilBrown2010-11-22
| | | | | | | | | | | | | | | | | | | | This allows the info for a single array to be extracted, so we don't have to write it into st->subarray. For consistency, implement container_content for super0 and super1, to just return the mdinfo for the single array. Signed-off-by: NeilBrown <neilb@suse.de>
* | ddf: remove duplicate container_member setting.NeilBrown2010-11-22
| | | | | | | | | | | | | | | | | | | | | | We were setting ->container_member twice in ddf get_info. Once to currentconf->vcnum, once to atoi(st->subarray). Both should be the same. For consistency with super-intel, use the first. Signed-off-by: NeilBrown <neilb@suse.de>
* | get_info_super: report which other devices are thought to be working/failed.NeilBrown2010-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | To accurately detect when an array has been split and is now being recombined, we need to track which other devices each thinks is working. We should never include a device in an array if it thinks that the primary device has failed. This patch just allows get_info_super to return a list of devices and whether they are thought to be working or not. Signed-off-by: NeilBrown <neilb@suse.de>
* | Report error in --update string is not recognised.NeilBrown2010-11-22
|/ | | | | | | | If an --update is requested by the relevant metadata doesn't understand it, print a useful message rather than silently ignoring the issue. Signed-off-by: NeilBrown <neilb@suse.de>
* Compile with -Wextra by defaultNeilBrown2010-08-05
| | | | | | This produced lots of warning, some of which pointed to actual bugs. Signed-off-by: NeilBrown <neilb@suse.de>
* Restore assembling of ddf containers.NeilBrown2010-07-29
| | | | | | | | The container_enough code change broke ddf as ddf never claimed 'enough' devices. So change it to always claim 'enough' to restore previous behaviour. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'fixes' into for-neilDan Williams2010-07-01
|\
| * Always assume SKIP_GONE_DEVS behaviour and kill the flagDan Williams2010-06-16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ...i.e. GET_DEVS == (GET_DEVS|SKIP_GONE_DEVS) A null pointer dereference in Incremental.c can be triggered by replugging a disk while the old name is in use. When mdadm -I is called on the new disk we fail the call to sysfs_read(). I audited all the locations that use GET_DEVS and it appears they can tolerate missing a drive. So just make SKIP_GONE_DEVS the default behaviour. Also fix up remaining unchecked usages of the sysfs_read() return value. Reported-by: Dave Jiang <dave.jiang@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * Incremental: honor an 'enough' flag from external handlersDan Williams2010-05-26
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Kill subarray v2Dan Williams2010-06-15
|/ | | | | | | | | | | | | | | | | | | | | | | | | Support for deleting a subarray out of a container. When all subarrays are deleted the component devices are converted back into spares, a --zero-superblock is still needed to kill the remaining metadata at this point. This operation is blocked when the subarray is active and may also be blocked by the metadata handler when deleting the subarray might change the uuid of other active subarrays. For example, with imsm, deleting subarray 'n' may change the uuid of subarrays with indexes > n. Deleting a subarray needs to be a container wide event to ensure disks that record the modified subarray list perceive other disks that did not receive this change as out of date. Notes: The st->subarray parsing in super-intel.c and super-ddf.c is updated to be more strict now that we are reading user supplied subarray values. Offline container modification shares actions that mdmon typically handles so promote is_container_member() and version_to_superswitch() (formerly find_metadata_methods()) to generic utility functions for the cases where mdadm performs the operation. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* IMSM/DDF: don't recognised these metadata on partitions.NeilBrown2010-04-29
| | | | | | | | | | | 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>
* ddf/intel: zero out old metadata before creating a container.NeilBrown2010-03-10
| | | | | | | | Matching the functionality already in super0 and super1, when we first create a container, remove any other recognisable metadata to ensure it doesn't cause confusion. Signed-off-by: NeilBrown <neilb@suse.de>