summaryrefslogtreecommitdiffstats
path: root/libdm
Commit message (Collapse)AuthorAgeFilesLines
...
* Add validation of name and uuidZdenek Kabelac2012-02-101-0/+5
| | | | Do not accept NULL pointers.
* Do not crash for NULL sort_keyZdenek Kabelac2012-02-101-0/+3
| | | | | Guard against NULL pointer for sort_key and let it behave like an empty string would have been passed in (i.e. no key).
* Return error for failing allocationZdenek Kabelac2012-02-101-1/+3
| | | | | Fix case, where final strdup would have failed and it would miss to return failure for this case and return success and NULL pointer.
* Add test for failing allocationZdenek Kabelac2012-02-101-1/+1
| | | | Avoid memcpy to NULL if realloc fails.
* Add test for memory allocation failuresZdenek Kabelac2012-02-101-67/+107
| | | | | | Replace asserts with test for failing memory allocation. Add at least stack traces. Index counter starts from 1 (0 reserved for error), so replacing fingerprint.
* Drop unreachable codeZdenek Kabelac2012-02-081-1/+0
|
* Use dm_asprintf to simplify codeZdenek Kabelac2012-02-081-9/+4
|
* Remove unneeded assignmentsZdenek Kabelac2012-02-081-4/+0
| | | | Variables have (or will have) those values set.
* Set all parameters to 0Zdenek Kabelac2012-02-081-1/+6
| | | | | | | | | | | | | Since the function dm_get_next_target() returns NULL as 'next' pointer so it's not a 'real' error - set 0 to all parameters when NULL is returned because of missing head. i.e. one of use case:: do { next = dm_get_next_target(dmt, next, &start, &length, &target_type, &params); size += length; } while (next);
* Fix fd resource leak in error pathZdenek Kabelac2012-02-081-1/+1
| | | | Use 'goto bad' to cleanup fd on error path.
* Ensure strncpy() function always ends with '\0'Zdenek Kabelac2012-02-081-2/+2
| | | | | Since last character needs to be \0 for string, pass buffer size smaller by 1 byte.
* Ensure whole info is initialisedZdenek Kabelac2012-01-251-6/+1
| | | | | Since _create_dm_tree_node is copying whole structure, make sure all members are initialized.
* Fix resource leak of file handleZdenek Kabelac2012-01-251-9/+8
| | | | | Introduces when added dm_device_get_name. Close file handle in all error paths.
* Thin send messages on activation resume code pathZdenek Kabelac2012-01-251-16/+11
| | | | | | Using PRELOAD part would lead to problems when the problem would happen before vg_write and vg_commit. Also this change is necessary for snapshot creation sequence.
* add constAlasdair Kergon2012-01-231-1/+3
|
* Reorder fns in libdm-deptree.Alasdair Kergon2012-01-232-408/+391
| | | | Tweak dm_config interface and remove FIXMEs.
* Thin handle empty thin volume caseZdenek Kabelac2012-01-191-1/+4
| | | | Report both values as 0 in case the volume is unused.
* Thin use consistentely metadataZdenek Kabelac2012-01-192-4/+6
| | | | | Do not shortcut to 'meta' and stay with 'metadata' Also matches kernel doc for dm API then.
* Update for gcc old-styleZdenek Kabelac2012-01-191-1/+1
|
* Move dm_task_set_newname from libdm-iface.c to libdm-common.cPeter Rajnoha2012-01-172-21/+21
|
* Add dm_device_get_name to get map name or block device name for given devno.Peter Rajnoha2012-01-112-23/+144
| | | | | | | | | | | | | This is accomplished by reading associated sysfs information. For a dm device, this is /sys/dev/block/major:minor/dm/name (supported in kernel version >= 2.6.29, for older kernels, the behaviour is the same as for non-dm devices). For a non-dm device, this is a readlink on /sys/dev/block/major:minor, e.g. /sys/dev/block/253:0 --> ../../devices/virtual/block/dm-0. The last component of the path is a proper kernel name (block device name). One can request to read only kernel names by setting the 'prefer_kernel_name' argument if needed.
* Add dm_uuid_prefix/dm_set_uuid_prefix for non-lvm users to override hard-codedAlasdair Kergon2012-01-103-62/+174
| | | | | | | LVM- prefix. Try harder not to leave stray empty devices around (locally or remotely) when reverting changes after failures while there are inactive tables.
* Use sysfs to set/get of read-aheadZdenek Kabelac2012-01-093-27/+114
| | | | | | | | If we know major:minor number of device (which is known after resume) we will try to use sysfs to set/get read ahead parameters of device. This avoid potential problem of blocking commands like 'dmsetup info' awaiting for device being usable for open/close - i.e. overfilled thin pool may block such command.
* Add Thin API for parsing thin statusZdenek Kabelac2011-12-212-0/+71
| | | | | | | Add dm_get_status_thin_pool and dm_get_status_thin functions to parse 'params' argument which is received via dm_get_next_target. Returns filed structure allocated from given mempool.
* Add dm_config_find_str_allow_emptyZdenek Kabelac2011-12-212-0/+7
| | | | Support empty string values.
* Make a cleaner split between config tree and config file functionality. MovePetr Rockai2011-12-183-152/+24
| | | | the latter out of libdm.
* Move dm_config_write out of libdm, back to lib/config, as config_write.Petr Rockai2011-12-112-64/+5
|
* In the dm_config_*get_* functions, make the actual value retrieval optionalPetr Rockai2011-12-111-5/+10
| | | | (useful for just checking that a given key is of a given type).
* Support the ability to replace specific devices in a RAID array.Jonathan Earl Brassow2011-11-301-2/+2
| | | | | | | | | | | | | | | | | 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
* Check target type name for DM_MAX_TYPE_NAME lengthZdenek Kabelac2011-11-182-14/+21
| | | | | | | | | | | | | | | | | | | | Avoid creation of target type name when it's longer then DM_MAX_TYPE_NAME (noticed by static analyzer where the sp.target_type might be missing '\0' at the end.) Before patch: $> dmsetup create long 0 1000 looooooooooooooooooooooooooong ^D device-mapper: reload ioctl failed: Invalid argument After patch: $> dmsetup create xxx 0 1000 looooooooooooooooooooooooooong Target type name looooooooooooooooooooooooooong is too long. Command failed
* Thin remove unused defineZdenek Kabelac2011-11-122-16/+6
| | | | | | | Remove DM_THIN_ERROR_DEVICE_ID from API. Remove API warning. Drop code that was using DM_THIN_ERROR_DEVICE_ID (already commented) Remove debug message which slipped in through some previous commit.
* Add missing free() for line that is malloc()'d by getline().Mike Snitzer2011-11-081-1/+3
|
* Fix _get_proc_number to be tolerant of malformed /proc/misc entries.Mike Snitzer2011-11-081-6/+5
| | | | Fixes issue reported here: http://lkml.org/lkml/2011/11/8/190
* Thin fix condition check for transation_idZdenek Kabelac2011-11-041-2/+2
| | | | | id2 must be checked. (missed in yesterday commit set).
* Thin api change for passing message into libdmZdenek Kabelac2011-11-032-48/+56
| | | | | | Avoid exposing another struct to the libdm user and use only simple dm_tree_node_add_thin_pool_message with 2 overloaded uint64_t values.
* Thin api change for dm_tree_node_add_thin_targetZdenek Kabelac2011-11-032-14/+28
| | | | | | | A little code shuffling and adding support for DM_THIN_ERROR_DEVICE_ID which might be eventually be used for activation of thin which is going to be deleted. For now we do not need it lvm.
* Thin fix compile warnsZdenek Kabelac2011-10-301-1/+3
| | | | | Test for dm_snprintf < 0. Add header for moved backup.
* Thin segment transaction_id movedZdenek Kabelac2011-10-301-13/+27
| | | | | | | Add a new node flag send_messages that is used to simplify test when to call _node_send_messages(). Add call to _node_send_messages when pool is deeper in the tree.
* Improve valgrind support when compiled with DEBUG_MEMZdenek Kabelac2011-10-281-3/+11
|
* Thin error messages clenaup and some indentZdenek Kabelac2011-10-281-4/+2
|
* Trying to fix the retry logicZdenek Kabelac2011-10-281-10/+29
| | | | | | | There should be no need for retry for our internal devices - it would be hinding our own bug in the tree processing. Update error messages to show also also device name. No WHATS_NEW - in release fix.
* Fix core on buggy config fileZdenek Kabelac2011-10-281-1/+5
| | | | Since fixed within unreleased version so no WHATS_NEW
* Add find_config_tree_str_allow_emptyZdenek Kabelac2011-10-282-5/+16
| | | | | Add function to allow read of empty strings as valid arguments. Add a warning message if string argument has ignored value.
* Update header commentZdenek Kabelac2011-10-281-1/+1
|
* Fix usage of DEBUG_ENFORCE_POOL_LOCKING with DEBUG_MEMZdenek Kabelac2011-10-231-0/+5
| | | | | Since DEBUG_MEM is storing own extra structure within returned memory chunk, glibc free must be used directly for posix_memaling() allocated block.
* Aling structure chunk on default aling sizeZdenek Kabelac2011-10-201-1/+1
| | | | | | Since we use 8 bytes by default for the pool allocation, keep the structure aligned with this size. (Somehow it was not applied in previous commit.)
* Mark chunk memory for free as defined again for valgrindZdenek Kabelac2011-10-201-0/+6
| | | | | | When DEBUG_MEM is used, the memory is trashed with extra pattern before real free() is called, and as this memory was marked as non accessible when used with valgrind, make it again usable.
* Simplify some pointer operationsZdenek Kabelac2011-10-201-4/+4
|
* Remove unused file from treeZdenek Kabelac2011-10-201-46/+0
|
* Just replace stack, return 0 with return_0Zdenek Kabelac2011-10-201-12/+6
|