summaryrefslogtreecommitdiffstats
path: root/lib/raid/raid.c
Commit message (Collapse)AuthorAgeFilesLines
* RAID: Add support for RAID10Jonathan Brassow2012-08-241-0/+15
| | | | | | This patch adds support for RAID10. It is not the default at this stage. The user needs to specify '--type raid10' if they would like RAID10 instead of stacked mirror over stripe.
* Revert free of allocated segtypeZdenek Kabelac2012-02-281-3/+2
| | | | | lvm_register_segtype takes ownership of segtype and call destructor for it in error path.
* Test seg pointer for non-nullZdenek Kabelac2012-02-271-1/+1
| | | | | As the function accepts NULL for 'seg' parameter, check for it before dereference.
* Make conversion from a synced 'mirror' to 'raid1' not cause a full resync.Jonathan Earl Brassow2012-02-131-1/+5
| | | | | | | | | | | It was not possible to pass down the DM_[FORCE|NO]SYNC flags to 'dm_tree_node_add_raid_target'. This meant that converting to 'raid1' from 'mirror' would cause a full resync. (It also meant that '--nosync' was ineffective when creating a 'raid1' LV.) I've taken the 'reserved' parameter in 'dm_tree_node_add_raid_target' and used it for the "flags" parameter. Now it is possible to pass the sync flags and any other flags that may come up.
* Free allocated segment type in error pathZdenek Kabelac2012-01-251-2/+4
|
* Support the ability to replace specific devices in a RAID array.Jonathan Earl Brassow2011-11-301-1/+1
| | | | | | | | | | | | | | | | | RAID is not like traditional LVM mirroring. LVM mirroring required failed devices to be removed or the logical volume would simply hang. RAID arrays can keep on running with failed devices. In fact, for RAID types other than RAID1, removing a device would mean substituting an error target or converting to a lower level RAID (e.g. RAID6 -> RAID5, or RAID4/5 to RAID0). Therefore, rather than removing a failed device unconditionally and potentially allocating a replacement, RAID allows the user to "replace" a device with a new one. This approach is a 1-step solution vs the current 2-step solution. example> lvconvert --replace <dev_to_remove> vg/lv [possible_replacement_PVs] '--replace' can be specified more than once. example> lvconvert --replace /dev/sdb1 --replace /dev/sdc1 vg/lv
* Fix log_error() usageZdenek Kabelac2011-09-241-1/+1
| | | | | Cosmetic - skip <bactrace> when error has been just printed in raid segtype. Add missing log_error if allocation would fail for unknown segtype.
* Replace const usage of dm_config_find_node with more appropriate value-lookupPetr Rockai2011-08-311-8/+7
| | | | | | | | | | | | | functionality. A number of bugs (copied and pasted all over the code) should disappear: - most string lookup based on dm_config_find_node would segfault when encountering a non-zero integer (the intention there was to print an error message instead) - check for required sections in metadata would have been satisfied by values as well (i.e. not sections) - encountering a section in place of expected flag value would have segfaulted (due to assumed but unchecked cn->v != NULL)
* Move the core of the lib/config/config.c functionality into libdevmapper,Petr Rockai2011-08-301-18/+18
| | | | | | | leaving behind the LVM-specific parts of the code (convenience wrappers that handle `struct device` and `struct cmd_context`, basically). A number of functions have been renamed (in addition to getting a dm_ prefix) -- namely, all of the config interface now has a dm_config_ prefix.
* Fix raid shared lib segtype registration (2.02.87).Alasdair Kergon2011-08-241-38/+68
|
* _ for static fnsAlasdair Kergon2011-08-191-25/+21
|
* Add support for m-way to n-way up-convert in RAID1 (no linear to n-way yet)Jonathan Earl Brassow2011-08-181-1/+18
| | | | | | | | | | | This patch adds the ability to upconvert a raid1 array - say from 2-way to 3-way. It does not yet support upconverting linear to n-way. The 'raid' device-mapper target allows for individual components (images) of an array to be specified for rebuild. This mechanism is used when adding new images to the array so that the new images can be resync'ed while the rest of the images in the array can remain 'in-sync'. (There is no mirror-on-mirror layering required.)
* Compiler warning fixes, better error messaging, and cosmetic changes.Jonathan Earl Brassow2011-08-131-0/+14
| | | | | | | | 1) add new function 'raid_remove_top_layer' which will be useful to other conversion functions later (also cleans up code) 2) Add error messages if raid_[extract|add]_images fails 3) Add function prototypes to prevent compiler warnings when compiling with '--with-raid=shared'
* Various code clean-ups (s/malloc/zalloc/, new msgs, etc)Jonathan Earl Brassow2011-08-111-3/+5
| | | | | | | Fix a couple more issues that kabi found. - Add some error messages in failure cases - s/malloc/zalloc/ - use vg->vgmem for lv names instead of vg->cmd->mem
* Need 'ifdef' checks around RAID monitoring functions as well to catch theJonathan Earl Brassow2011-08-111-1/+4
| | | | case where the user does not want dmeventd support compiled in.
* Fix build of raid without dmeventd.Milan Broz2011-08-111-2/+6
|
* Add dmeventd monitoring for RAID devices.Jonathan Earl Brassow2011-08-111-0/+43
|
* Add basic RAID segment type(s) support.Jonathan Earl Brassow2011-08-021-0/+352
Implementation described in doc/lvm2-raid.txt. Basic support includes: - ability to create RAID 1/4/5/6 arrays - ability to delete RAID arrays - ability to display RAID arrays Notable missing features (not included in this patch): - ability to clean-up/repair failures - ability to convert RAID segment types - ability to monitor RAID segment types