1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

1852 Commits

Author SHA1 Message Date
Zdenek Kabelac
8382fc3e85 Fix memory leak in debug mode of restart_clvmd() error path 2010-12-22 12:14:11 +00:00
Zdenek Kabelac
1febdf9a37 Log error state from pthread_join operation
Value jstat is unused - so replace it with logging via log_sys_error().
2010-12-22 12:10:56 +00:00
Alasdair Kergon
c37f0c7d7c post-release 2010-12-21 21:08:51 +00:00
Alasdair Kergon
ad18cacfa9 pre-release 2010-12-21 01:08:29 +00:00
Zdenek Kabelac
b7149bbe45 Add missing test for reallocation error. 2010-12-20 14:38:22 +00:00
Zdenek Kabelac
6bc840fd2a Add check for unlink errors 2010-12-20 14:08:46 +00:00
Zdenek Kabelac
9d3be13f4f Use dm_free for dm_malloc-ed areas in _clog_ctr/_clog_dtr (cmirrord).
Use dm_zalloc to obtain zeroed memory block.
Use dm_free for dm_ allocated memory blocks.
Test close() for error.
2010-12-20 13:57:19 +00:00
Zdenek Kabelac
f7e7f3e3ed Add checks for allocation errors in config node clonning.
Add checks for clonning allocation a fail-out when something is
not allocated correctly.

Also move var declaration to the begining of the function
and fix log_error messages.
2010-12-20 13:53:10 +00:00
Zdenek Kabelac
9376ec18cd Fix error path if regex engine cannot be created in _build_matcher().
Fix only 'stack' printing with full function error exit.
2010-12-20 13:45:39 +00:00
Zdenek Kabelac
d40d166f91 Switch void* to char* arithmetic 2010-12-20 13:37:26 +00:00
Zdenek Kabelac
66781f5d5a Fix wrong cast to char*
As cmd->cmd_line is already const char pointer it's not needed to cast already
const char pointer to char pointer.
2010-12-20 13:28:04 +00:00
Zdenek Kabelac
9366d4e391 update 2010-12-20 13:17:56 +00:00
Zdenek Kabelac
760d1fac55 Add more strict const pointers around config tree
To have better control were the config tree could be modified use more
const pointers and very carefully downcast them back to non-const
(for config tree merge).
2010-12-20 13:12:55 +00:00
Zdenek Kabelac
bebfa29b48 Fix NULL pointer check for *buf
As ternary operator has lower priority then add operation, this check
was not doing what seemed to be expected.

So enclose the test in braces and check for NULL in *buf.
2010-12-17 12:37:49 +00:00
Alasdair Kergon
22bb69eb99 Fix device.c #include to ensure 64-bit fopen64 use. (2.02.51) (robbat2) 2010-12-15 12:49:55 +00:00
Peter Rajnoha
91106a4a2d Create /var/run/lvm directory during clvmd initialisation if missing.
We need to be sure that /var/run and /var/lock is always there.
(E.g. these two directories could be using tmpfs which then loose
all the content after reboot.)
2010-12-13 10:49:02 +00:00
Peter Rajnoha
7dfce0e467 Add new dm_prepare_selinux_context fn to libdevmapper and use it throughout.
Detect existence of new SELinux selabel interface during configure.
Use new dm_prepare_selinux_context instead of dm_set_selinux_context.

We should set the SELinux context before the actual file system object creation.
The new dm_prepare_selinux_context function sets this using the selabel_lookup
fn in conjuction with the setfscreatecon fn. If selinux/label.h interface
(that should be a part of the selinux library) is not found during configure,
we fallback to the original matchpathcon function instead.
2010-12-13 10:43:56 +00:00
Alasdair Kergon
acb037657c Fix scanning of VGs without in-PV mdas.
Set cmd->independent_metadata_areas if metadata/dirs or disk_areas in use.
- Identify and record this state.

Don't skip full scan when independent mdas are present even if memlock is set.
- Clusters and OOM aren't supported, so no problem doing the proper scans.

Avoid revalidating the label cache immediately after scanning.
- A simple optimisation.

Support scanning for a single VG in independent mdas.
- Not used by the fix but I left it in anyway as later patches might use it.
2010-12-10 22:39:52 +00:00
Alasdair Kergon
32342298e1 . 2010-12-09 00:10:24 +00:00
Alasdair Kergon
1fbc1dec0e . 2010-12-08 23:09:45 +00:00
Alasdair Kergon
2b82bd79f5 Rename vg_release to free_vg. 2010-12-08 20:50:48 +00:00
Alasdair Kergon
e8bed35ddf Cope better with an undefined target_percent operation in _percent_run. 2010-12-08 19:26:35 +00:00
Zdenek Kabelac
54fca7b1ca Remove reset of vg->vgmem pointer as it is access of already release memory
This reset of vgmem pointer causes access of already released memory.
(_vg_make_handle allocates vg from vgmem pool itself - which is a bit tricky)

Interestingly this memory fault was missed by our test suite.
2010-12-08 10:45:37 +00:00
Alasdair Kergon
122ba73eaf post-release 2010-12-06 22:13:10 +00:00
Alasdair Kergon
9d03132282 pre-release 2010-12-06 17:57:14 +00:00
Alasdair Kergon
ea7c621b0a Fix debug logging of derived flag LCK_CACHE in clvmd. 2010-12-06 17:37:09 +00:00
Zdenek Kabelac
98e6fdec8b Check str_list_add() success
Report error if str_list_add fails.
2010-12-01 13:05:06 +00:00
Zdenek Kabelac
414813e349 Check lv_info() success
Add log_error message for lv_info failure and exit from futher
processing.

Replace 'leg' occurence in debug message with 'image' which
is used in other messages.
2010-12-01 13:01:36 +00:00
Zdenek Kabelac
166597d998 Add backtraces for errors
Add stack;  backtraces when error is reported from dev_set() or
dev_close_immediate().
2010-12-01 12:56:39 +00:00
Zdenek Kabelac
250238d04c Log error from unlink failure 2010-12-01 12:41:49 +00:00
Zdenek Kabelac
062181292a Add logging for pipe write() and close() error
Check values from write() and close() system calls.

FIXME: Missing wrapper around 'write()'.
2010-12-01 10:46:20 +00:00
Zdenek Kabelac
e3552d738c Check result of vginfo_from_vgname
Check for some potential internal error.
2010-12-01 10:39:28 +00:00
Zdenek Kabelac
2937b51eaa Fallback to full rescan for missing device
Fix bug when NULL could have been passsed as 'data'
to _add_pv_to_list() if 'dev' is NULL.

Now it fallbacks to complete scan.
2010-12-01 10:33:55 +00:00
Petr Rockai
c8c4eda71f What's new. 2010-11-30 23:03:35 +00:00
Zdenek Kabelac
8865a4c19e Add stack trace for error path
If dm_task_set_cookie() fails print stack trace, but keep going on.
2010-11-30 22:40:19 +00:00
Zdenek Kabelac
14caa4a2d0 Add missing test for failed pool allocation
Add test for NULL from dm_poll_create.
Reorder dm_pool_destroy() before file close and add label out:.
Avoid leaking file descriptor if the allocation fails.
2010-11-30 22:23:35 +00:00
Zdenek Kabelac
a8d4cd68eb Replace snprintf with dm_snprintf
Use dm_snprintf with known error case return code (-1).
2010-11-30 22:16:25 +00:00
Zdenek Kabelac
41cf252f0b Check reallocated buffer for NULL before use
As *buf is reallocated in case CLVMD_CMD_TEST: test for NULL is needed
before printing status.
(realloc() == NULL and status != 0)
2010-11-30 22:11:26 +00:00
Alasdair Kergon
1415afcdba Fix memory leak when VG allocation policy in metadata is invalid.
Ignore unrecognised allocation policy found in metadata instead of aborting.
Fix another missing vg_release() in _vg_read_by_vgid.
2010-11-29 18:35:37 +00:00
Zdenek Kabelac
21ba805499 Fix memory leak in error path
Nicely hidden memory leak in outf macro error path.
This macro is using out_text() and does automagical return_0.
That would leak tag_buffer allocated memory.

As there was same code for tags output - create _out_tags() function.
2010-11-29 12:19:58 +00:00
Zdenek Kabelac
201222ebad Reset vg pointer after release
Set vg to NULL after releasing it as the following memlock() test may
lead to goto for the second call of vg_release() with the already
released vg pointer.
2010-11-29 11:08:14 +00:00
Zdenek Kabelac
99aacef51c Fix check for empty system_dir
Fixing check for zero length system_dir string.
2010-11-29 10:58:32 +00:00
Petr Rockai
964916f8f3 Update WHATS_NEW. 2010-11-25 17:16:41 +00:00
Zdenek Kabelac
46f84d5cb9 Add missing destrustion of cmd_context
Lvm1 fallback code missed to destroy cmd_context in error path.
2010-11-24 09:53:31 +00:00
Zdenek Kabelac
9d6d98c900 Fix memory leak in error path
Release allocated path buffer in error path.
2010-11-24 09:43:18 +00:00
Zdenek Kabelac
e8ec0ba2e3 Fix resource leak of dlopened pointer
Add missing dlclose in _init_formats() error path.
Use return_0 to print stack trace from the call.
2010-11-24 09:34:34 +00:00
Zdenek Kabelac
2044eacc7e Add missing fclose
Fixing resource leak in _umount().

CHECKME: mountpoints with spaces need to be checked
2010-11-23 21:19:45 +00:00
Zdenek Kabelac
aaa7f4c966 Move arg_vgnames from local scope
As gcc puts probably all vars on stack this bug was not noticed in runtime.
Patch fixes referencing local scope list variable.
2010-11-23 20:39:13 +00:00
Zdenek Kabelac
f46de65682 Do not call dm_task_destroy with NULL 2010-11-23 18:29:06 +00:00
Zdenek Kabelac
0a178d853a Add missing closedir() - fixes resource leak 2010-11-23 15:28:54 +00:00