Zdenek Kabelac
5dc08c01d3
Release_vg instead of plain free in error path
2012-02-13 10:53:31 +00:00
Zdenek Kabelac
ec6a14f40a
Log error reporting for failing _alloc_pv
...
Drop unneeded zeroing of zalloced memory region.
2012-02-13 10:51:52 +00:00
Zdenek Kabelac
7cf73cbc1f
Do not write to -1 buffer address
...
In case of zero bytes would be read from sysfs, it would store '\0' on
temp_buf[-1] address.
Simplify some buffer length calculation and use strcpy if we've just
checked string fits in give buffer.
Replace jump label error: with bad: commonly used in libdm.
2012-02-13 10:49:28 +00:00
Zdenek Kabelac
193c832d12
Remove duplicit test
...
When it's space it's also not a '\0'.
2012-02-13 10:45:26 +00:00
Milan Broz
82e18a35a9
Update autoconf.
2012-02-13 07:30:24 +00:00
Fabio M. Di Nitto
69b9a614c7
In the new corosync world, dlm is a standalone service.
...
Fix clvmd init script to Require dlm service when building for the
new corosync or clvmd will fail to start.
2012-02-13 05:24:57 +00:00
Alasdair Kergon
52fdced782
post-release
2012-02-13 00:23:21 +00:00
Alasdair Kergon
2a7e2fe2d3
pre-release
2012-02-12 23:02:52 +00:00
Alasdair Kergon
3b6c6f1319
FMT_INSTANCE_VG is redundant now
2012-02-12 23:01:19 +00:00
Alasdair Kergon
11b3b12336
FMT_INSTANCE_PV is no longer used
2012-02-12 22:37:24 +00:00
Alasdair Kergon
b8a4a2b40b
use stack consistently if 0 is considered an error
2012-02-12 21:42:43 +00:00
Alasdair Kergon
3e15add713
missing error mesg
2012-02-12 21:37:03 +00:00
Alasdair Kergon
06eaf8974a
remove unused bits after fid changes
2012-02-12 20:19:39 +00:00
Alasdair Kergon
4ceec2023f
give standard error message if lstat fails unexpectedly
2012-02-12 20:17:12 +00:00
Zdenek Kabelac
777a797ec3
Fix message check
...
Check pointer from strchr for NULL instead of crash later.
Badly formated message would have crash dmeventd otherwise.
2012-02-10 15:17:52 +00:00
Zdenek Kabelac
c559180cca
Check for deps pointer before dererence
...
As _deps() call may return NULL - check for it.
2012-02-10 14:48:28 +00:00
Zdenek Kabelac
9fde529762
Add validation of name and uuid
...
Do not accept NULL pointers.
2012-02-10 14:42:28 +00:00
Zdenek Kabelac
50504ab73e
Do not crash for NULL sort_key
...
Guard against NULL pointer for sort_key and let it behave like an empty
string would have been passed in (i.e. no key).
2012-02-10 14:00:07 +00:00
Zdenek Kabelac
514976816d
Return error for failing allocation
...
Fix case, where final strdup would have failed and it would miss to return
failure for this case and return success and NULL pointer.
2012-02-10 13:56:19 +00:00
Zdenek Kabelac
00067fb64a
Add test for failing allocation
...
Avoid memcpy to NULL if realloc fails.
2012-02-10 13:52:05 +00:00
Zdenek Kabelac
f6aab411f8
Add test for memory allocation failures
...
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.
2012-02-10 13:49:29 +00:00
Zdenek Kabelac
c966f07bbd
Remove unreachable code
2012-02-10 13:46:23 +00:00
Petr Rockai
e8ada4a717
What's new.
2012-02-10 02:56:54 +00:00
Petr Rockai
14d7b7b4e9
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
395ee036d7
What's new: lvmcache.
2012-02-10 01:29:46 +00:00
Petr Rockai
1a28df6bb4
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
2936951d94
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
e98b640d5d
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
6d29fe0f33
Thin add pool_below_threshold
...
Test both data and metadata percent usage.
2012-02-08 13:05:38 +00:00
Zdenek Kabelac
5365e4a53f
A bit more readable code
...
Just a minor readability conversion.
2012-02-08 13:03:40 +00:00
Zdenek Kabelac
70e3728446
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
0cb3bdcfce
Drop unreachable code
2012-02-08 12:59:45 +00:00
Zdenek Kabelac
d735798674
Use dm_asprintf to simplify code
2012-02-08 12:59:19 +00:00
Zdenek Kabelac
74c7c69d34
Some fixmes
...
'len' calculation is unused ?
Unreachable code could be removed or moved upward ?
2012-02-08 12:57:15 +00:00
Zdenek Kabelac
7ce534f911
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
f03f322f13
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
c929a0b3c8
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
6bea32ccf2
Remove duplicate test
...
Tested condition has been already evaluated before
For strlen() code has already excluded <ID_LEN.
For repairing, already tested (!argc && !repairing) before.
2012-02-08 11:41:18 +00:00
Zdenek Kabelac
84facc4fa5
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
7940545204
Remove unneeded assignments
...
Variables have (or will have) those values set.
2012-02-08 11:36:18 +00:00
Zdenek Kabelac
cc525412f1
Keep page_size as signed number
...
Since it's return value from sysconf and is checked for <0.
2012-02-08 11:34:46 +00:00
Zdenek Kabelac
962fd76f26
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
6e40adde76
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
fb6a209080
Set all parameters to 0
...
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, ¶ms);
size += length;
} while (next);
2012-02-08 11:25:09 +00:00
Zdenek Kabelac
e6b610e8ed
Check that whole locking_dir fits _lock_dir buffer
2012-02-08 11:17:34 +00:00
Zdenek Kabelac
bb0862fbb4
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
e2d2f6c7b7
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
e48d39cba0
Fix fd resource leak in error path
...
Use 'goto bad' to cleanup fd on error path.
2012-02-08 11:07:17 +00:00
Zdenek Kabelac
4443aa41cc
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
24da0046d5
Set status for error path
...
Do not leave status unitialized, since in some cases, it's tested,
when the function returns error.
2012-02-08 10:56:17 +00:00