Zdenek Kabelac
382a1a6bea
Add internal error to guard vgname2 NULL dereference
2012-02-13 14:26:15 +00:00
Zdenek Kabelac
172c87f7ca
Never try to test character past given buffer
...
In case units[0] would be already '\0', do not check units[1].
2012-02-13 14:23:40 +00:00
Zdenek Kabelac
73e62cdc11
Add internal error for unsupported code paths
...
Patch mainly helps static analyzers to better work with code paths
lvm code should never trigger.
2012-02-13 11:25:56 +00:00
Zdenek Kabelac
3e74542b5d
Add check for allocation failure
2012-02-13 11:16:42 +00:00
Zdenek Kabelac
cbe6bcd593
Add check for rimage name allocation failure
2012-02-13 11:10:37 +00:00
Zdenek Kabelac
bed744c15d
Add check for mda_copy failure
2012-02-13 11:09:25 +00:00
Zdenek Kabelac
fde44d055b
Add check for failure
2012-02-13 11:07:55 +00:00
Zdenek Kabelac
52f2f3eae4
Add free_orphan_vg
...
Move commod code to destroy orphan VG into free_orphan_vg() function.
Use orphan vgmem for creation of PV lists.
Remove some free_pv_fid() calls (FIXME: check all of them)
FIXME: Check whether we could merge release_vg back again for all VGs.
2012-02-13 11:03:59 +00:00
Zdenek Kabelac
65079de265
If the same fid is already same avoid ref_counting
2012-02-13 11:01:34 +00:00
Zdenek Kabelac
960ee343f3
Add missing test for failure of lvmcache_foreach_pv
2012-02-13 10:58:20 +00:00
Zdenek Kabelac
f9411bb2af
Clean error paths for format instance
...
With updated orphan VG code this code needed some updates.
Add missing log_error for allocation failures.
2012-02-13 10:56:31 +00:00
Zdenek Kabelac
874a4fd80d
Release_vg instead of plain free in error path
2012-02-13 10:53:31 +00:00
Zdenek Kabelac
bbf98c19a8
Log error reporting for failing _alloc_pv
...
Drop unneeded zeroing of zalloced memory region.
2012-02-13 10:51:52 +00:00
Zdenek Kabelac
69ad7c1aff
Remove duplicit test
...
When it's space it's also not a '\0'.
2012-02-13 10:45:26 +00:00
Alasdair Kergon
b719e3d323
FMT_INSTANCE_VG is redundant now
2012-02-12 23:01:19 +00:00
Alasdair Kergon
ba14fff2af
FMT_INSTANCE_PV is no longer used
2012-02-12 22:37:24 +00:00
Alasdair Kergon
f3f6c17250
use stack consistently if 0 is considered an error
2012-02-12 21:42:43 +00:00
Alasdair Kergon
2a434c479d
missing error mesg
2012-02-12 21:37:03 +00:00
Alasdair Kergon
10670c641b
remove unused bits after fid changes
2012-02-12 20:19:39 +00:00
Alasdair Kergon
72b50d7fd2
give standard error message if lstat fails unexpectedly
2012-02-12 20:17:12 +00:00
Petr Rockai
6e41729eb8
Keep a global (per-format) orphan_vg and keep any and all orphan PVs linked to
...
it. Avoids the need for FMT_INSTANCE_PV and enables further simplifications. No
functional change, internal refactor only.
2012-02-10 02:53:03 +00:00
Petr Rockai
8e5f7cf3dc
Move lvmcache data structures behind an API (making the structures private to
...
lvmcache.c). No functional change.
2012-02-10 01:28:27 +00:00
Peter Rajnoha
5fa417a9c0
Stop processing lvextend if trying to extend a mirror that is being recovered.
...
Missing correct return value in lv_extend fn.
2012-02-09 15:13:42 +00:00
Zdenek Kabelac
b93c1332d1
Move label_init up in code stack
...
label_exit() is called destroy_toolcontext() and we are now
using standard dm_list function for destroy, we have to make sure
dm_list gets initialized properly.
2012-02-08 13:44:49 +00:00
Zdenek Kabelac
a7e2da0585
Thin add pool_below_threshold
...
Test both data and metadata percent usage.
2012-02-08 13:05:38 +00:00
Zdenek Kabelac
94f88a4f14
Fix test for lv_snapshot_percent
...
Do not check for PERCENT_MERGE_FAILED if the lv_snapshot_percent() failed.
(test for snap_percent would be testing uninitialized value).
2012-02-08 13:02:07 +00:00
Zdenek Kabelac
9278655de1
Some fixmes
...
'len' calculation is unused ?
Unreachable code could be removed or moved upward ?
2012-02-08 12:57:15 +00:00
Zdenek Kabelac
462835faa0
Switch to return void
...
List delete cannot fail, so there is no reason to test for error.
2012-02-08 12:52:58 +00:00
Zdenek Kabelac
33dea28e23
Use dm_snprintf and improve error handling
...
Add standard error reporting with error logging.
Use plain alloc instead of zalloc for string buffer.
Use dm_snprintf with valid test for <0.
2012-02-08 12:50:10 +00:00
Zdenek Kabelac
7ffca95bb6
Add range test for device number
...
Check the output of atoi is in valid range.
2012-02-08 12:48:14 +00:00
Zdenek Kabelac
d75c5f06f0
Replace snprintf with dm_snprintf
...
snprintf testing for negative is replaced with dm_snprintf where this
test really works.
Add missing test for result of dm_snprintf().
2012-02-08 11:40:02 +00:00
Zdenek Kabelac
84fd8ea4bd
Move done jump lower
...
Since before 'goto done' is bufused zeroed, it would otherwise write 1
byte in front of buffer.
2012-02-08 11:31:29 +00:00
Zdenek Kabelac
b63b775143
Add boundary test for number of mirror devs and logs
...
As atoi may return negative value - test for both limits.
Test log_args for limits before calling alloca().
Code from dmeventd mirror plugin should probably share same code as
we have in mirrored.c.
2012-02-08 11:29:13 +00:00
Zdenek Kabelac
0154bcf0a7
Check that whole locking_dir fits _lock_dir buffer
2012-02-08 11:17:34 +00:00
Zdenek Kabelac
1a39fa0073
Move close few lines
...
Since the function dev_close() has code path, which really could close
file (for unlocked vg) and destroy dev handler, stay on safe side and move
the close few lines later, even our current use case shouldn't trigger
such scenario.
2012-02-08 11:15:38 +00:00
Zdenek Kabelac
02aeb23f1f
Use dm_list_iterate_items_safe
...
And avoid direct access to list member variables.
Inline _free_li().
2012-02-08 11:12:18 +00:00
Zdenek Kabelac
5dfd775384
Ensure strncpy() function always ends with '\0'
...
Since last character needs to be \0 for string,
pass buffer size smaller by 1 byte.
2012-02-08 11:05:04 +00:00
Zdenek Kabelac
ee54e43702
Fix resource leaks for failing allocation
...
In case, something would fail during format initialization,
return allocated memory.
2012-02-08 10:49:36 +00:00
Zdenek Kabelac
12ac6f9f11
Release allocated resources in error path
...
If composite_filter_create() fails, release filters.
2012-02-08 10:46:24 +00:00
Zdenek Kabelac
7b408a08ef
Check result of lstat
...
If lstat returns errno different from ENOENT, do not use the content of
struct stat 'buf'.
2012-02-08 10:43:42 +00:00
Alasdair Kergon
b167ca28b0
Adjust comments
2012-02-01 15:05:53 +00:00
Zdenek Kabelac
42b5c54092
Add synchornization point in mirror log init.
...
Put extra sync point when mirror log is deactivated and before
it's activated for the second time.
2012-02-01 13:50:36 +00:00
Zdenek Kabelac
ab852ffe66
Disable partial activation for thin LVs and LVs with all missing segments
...
Count number of error and existing areas and if there is no existing area
for the LV avoid its activation.
Always disable partial activatio for thin volumes.
For mirrors currently put in hack to let it pass with a special name
since current mirror code needs to activate such LV during some operations.
2012-02-01 13:47:27 +00:00
Zdenek Kabelac
dfb679e5c7
Avoid warning for small pv_min_size
...
Do not print warning for pv_min_size set in range between 512KB and 2MB.
2012-02-01 13:42:18 +00:00
Zdenek Kabelac
489bf2fbdf
Minor consistency update for debugging messages
...
Use mlock/munlock for debugging lines.
2012-02-01 10:48:22 +00:00
Alasdair Kergon
1368dc905a
lost line
2012-02-01 02:11:43 +00:00
Alasdair Kergon
72abf1d880
Track unreserved space for all alloc policies and then permit NORMAL to place
...
log and data on same single PV.
2012-02-01 02:10:45 +00:00
Alasdair Kergon
b6d7a48480
Automatically detect whether corosync clvmd needs to use confdb or cmap. (fabio)
2012-01-31 21:21:53 +00:00
Zdenek Kabelac
15fd61e492
Fix data% reporting
...
For reading % of mapped size of thin volume use as origin for
old style snapshot '-real' device needs to be queried.
Fix log_error report given for lvs -a in this case.
2012-01-28 20:12:26 +00:00
Zdenek Kabelac
7012268499
Thin for_each_sub_lv
...
Adapt to scan thin dependency LVs
2012-01-26 21:39:32 +00:00