1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-23 21:35:29 +03:00
Commit Graph

1857 Commits

Author SHA1 Message Date
Jonathan Earl Brassow
10e3bdcce3 Change to correct cmirrord return code is user visible - update WHATS_NEW
file.
2011-01-04 21:33:06 +00:00
Milan Broz
65599cfb58 Fix wrongly paired unlocking of global lock in pvchange. (2.02.66) 2010-12-23 14:23:30 +00:00
Zdenek Kabelac
e65561feae Add backtraces for backup and backup_remove fail paths 2010-12-22 15:36:41 +00:00
Zdenek Kabelac
adb5fb90b1 Detect errors from dm_task_set calls
Check for errors in dm_task_set calls.
Use  goto_bad macro with stack trace.
Replace  label  failed: with bad:.
2010-12-22 15:28:44 +00:00
Zdenek Kabelac
96a20ae9d4 Add backtraces for archive and backup_locally
If archive or back_locally fails - add stack trace.
2010-12-22 13:45:33 +00:00
Zdenek Kabelac
0cadf7ba66 Fix memory leak in debug mode of restart_clvmd() error path 2010-12-22 12:14:11 +00:00
Zdenek Kabelac
bb5ccf8869 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
e45d947322 post-release 2010-12-21 21:08:51 +00:00
Alasdair Kergon
385933819e pre-release 2010-12-21 01:08:29 +00:00
Zdenek Kabelac
58e3ba19a2 Add missing test for reallocation error. 2010-12-20 14:38:22 +00:00
Zdenek Kabelac
b5d23f1591 Add check for unlink errors 2010-12-20 14:08:46 +00:00
Zdenek Kabelac
28708849a9 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
9f1538687a 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
9c146b8a6f 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
1c6b3062bf Switch void* to char* arithmetic 2010-12-20 13:37:26 +00:00
Zdenek Kabelac
97d680c924 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
12389f2089 update 2010-12-20 13:17:56 +00:00
Zdenek Kabelac
1ea4c6d449 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
8a8a182679 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
2f19cff4df Fix device.c #include to ensure 64-bit fopen64 use. (2.02.51) (robbat2) 2010-12-15 12:49:55 +00:00
Peter Rajnoha
e805bfb103 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
a1cbc61c34 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
3415f08149 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
8a9dbd13e7 . 2010-12-09 00:10:24 +00:00
Alasdair Kergon
1e2f3763cb . 2010-12-08 23:09:45 +00:00
Alasdair Kergon
bc9b386f80 Rename vg_release to free_vg. 2010-12-08 20:50:48 +00:00
Alasdair Kergon
b4940ed53c Cope better with an undefined target_percent operation in _percent_run. 2010-12-08 19:26:35 +00:00
Zdenek Kabelac
1e9221af45 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
200675b506 post-release 2010-12-06 22:13:10 +00:00
Alasdair Kergon
6424bd9e6d pre-release 2010-12-06 17:57:14 +00:00
Alasdair Kergon
7ce425114e Fix debug logging of derived flag LCK_CACHE in clvmd. 2010-12-06 17:37:09 +00:00
Zdenek Kabelac
b0e9ba5f4b Check str_list_add() success
Report error if str_list_add fails.
2010-12-01 13:05:06 +00:00
Zdenek Kabelac
7837f37e21 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
966bfcef27 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
70ebb39097 Log error from unlink failure 2010-12-01 12:41:49 +00:00
Zdenek Kabelac
22812bc83c 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
83c37777f1 Check result of vginfo_from_vgname
Check for some potential internal error.
2010-12-01 10:39:28 +00:00
Zdenek Kabelac
a2f563f84f 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
d5c94a08a7 What's new. 2010-11-30 23:03:35 +00:00
Zdenek Kabelac
b13837c2c0 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
5dcb17df67 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
5b94a87589 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
3698ce35b1 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
3c3e95a5a8 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
4f4c217659 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
d41c8aed57 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
5b679c060d Fix check for empty system_dir
Fixing check for zero length system_dir string.
2010-11-29 10:58:32 +00:00
Petr Rockai
1dea3b9fab Update WHATS_NEW. 2010-11-25 17:16:41 +00:00
Zdenek Kabelac
f912e2c887 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
732528e1c0 Fix memory leak in error path
Release allocated path buffer in error path.
2010-11-24 09:43:18 +00:00