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

Fix debug logging of derived flag LCK_CACHE in clvmd.

This commit is contained in:
Alasdair Kergon 2010-12-06 17:37:09 +00:00
parent 98e6fdec8b
commit ea7c621b0a
3 changed files with 33 additions and 27 deletions

View File

@ -1,23 +1,23 @@
Version 2.02.78 - Version 2.02.78 -
==================================== ====================================
Check str_list_add() success in _add_stripe_seg(). Abort if segment tag allocation fails in pool format _add_stripe_seg.
Check lv_info() success in _mirrored_transient_status(). Abort in _mirrored_transient_status if referenced log/image LV is not active.
Add backtraces for dev_set() and dev_close_immediate() errors in set_lv(). Add backtraces for dev_set() and dev_close_immediate() errors in set_lv().
Add logging for unlink() error in clvmd remove_lockfile(). Log any unlink() error in clvmd remove_lockfile().
Add logging for pipe write() and close() error in clvmd child_init_signal(). Log any pipe write() or close() errors in clvmd child_init_signal().
Add test for existance of orphan vginfo in _lvmcache_update_vgname(). Detect if orphan vginfo was lost from cache before _lvmcache_update_vgname().
Do a full rescan if some device is missing in read_pvs_in_vg(). Do a full rescan if some device is missing in lvm1 format read_pvs_in_vg.
Avoid misleading warnings in vgextend --restoremissing in certain cases. Add missing check that dm_pool_create succeeded in write_config_node().
Add error path stack traces for _process_mapper_dir(), _create_and_load_v4(). Use dm_snprintf in clvmd-command.c to ensure an overlong buffer is truncated.
Add missing test for failed pool allocation in write_config_node(). Don't write to buffer if its reallocation failed in clvmd do_command().
Replace snprintf with dm_snprintf in clvmd-command.c. Switch from float to fixed point percentage handling.
Check reallocated buffer for NULL before use in clvmd do_command(). Avoid misleading missing PV warnings in vgextend --restoremissing.
Fix memory leak when VG allocation policy in metadata is invalid. Fix memory leak when VG allocation policy in metadata is invalid.
Ignore unrecognised allocation policy found in metadata instead of aborting. Ignore unrecognised allocation policy found in metadata instead of aborting.
Factor out tag printing into _out_tags and avoid leaking string buffer. Factor out tag printing into _out_tags and avoid leaking string buffer.
Remove some unused variables & assignments. Remove some unused variables & assignments.
Add missing vg_release calls in _vg_read_by_vgid. Add missing vg_release calls in _vg_read_by_vgid.
Still to fix: LCK_CACHE/CLUSTER_VG printing/FIXME Fix debug logging of derived flag LCK_CACHE in clvmd.
Fix test for no system_dir in _init_backup(). Fix test for no system_dir in _init_backup().
Disallow lvconvert ops that both allocate & free supplied PEs in a single cmd. Disallow lvconvert ops that both allocate & free supplied PEs in a single cmd.
Fix liblvm seg_size to give bytes not sectors. Fix liblvm seg_size to give bytes not sectors.

View File

@ -1,5 +1,6 @@
Version 1.02.59 - Version 1.02.59 -
==================================== ====================================
Add backtraces to _process_mapper_dir and _create_and_load_v4 error paths.
Remove superfluous checks for NULL before calling dm_free. Remove superfluous checks for NULL before calling dm_free.
Version 1.02.58 - 22nd November 2010 Version 1.02.58 - 22nd November 2010

View File

@ -44,11 +44,7 @@ struct lv_info {
int lock_mode; int lock_mode;
}; };
/* static const char *decode_full_locking_cmd(uint32_t cmdl)
* FIXME: 8bit value passed here -
* so only LCK_XXX defines < 0x100 can be decoded
*/
static const char *decode_locking_cmd(unsigned char cmdl)
{ {
static char buf[128]; static char buf[128];
const char *type; const char *type;
@ -117,11 +113,20 @@ static const char *decode_locking_cmd(unsigned char cmdl)
cmdl & LCK_NONBLOCK ? "|NONBLOCK" : "", cmdl & LCK_NONBLOCK ? "|NONBLOCK" : "",
cmdl & LCK_HOLD ? "|HOLD" : "", cmdl & LCK_HOLD ? "|HOLD" : "",
cmdl & LCK_LOCAL ? "|LOCAL" : "", cmdl & LCK_LOCAL ? "|LOCAL" : "",
cmdl & LCK_CLUSTER_VG ? "|CLUSTER_VG" : ""); cmdl & LCK_CLUSTER_VG ? "|CLUSTER_VG" : "",
cmdl & LCK_CACHE ? "|CACHE" : "");
return buf; return buf;
} }
/*
* Only processes 8 bits: excludes LCK_CACHE.
*/
static const char *decode_locking_cmd(unsigned char cmdl)
{
return decode_full_locking_cmd((uint32_t) cmdl);
}
static const char *decode_flags(unsigned char flags) static const char *decode_flags(unsigned char flags)
{ {
static char buf[128]; static char buf[128];
@ -676,15 +681,6 @@ void do_lock_vg(unsigned char command, unsigned char lock_flags, char *resource)
uint32_t lock_cmd = command; uint32_t lock_cmd = command;
char *vgname = resource + 2; char *vgname = resource + 2;
DEBUGLOG("do_lock_vg: resource '%s', cmd = %s, flags = %s, memlock = %d\n",
resource, decode_locking_cmd(command), decode_flags(lock_flags), memlock());
/* P_#global causes a full cache refresh */
if (!strcmp(resource, "P_" VG_GLOBAL)) {
do_refresh_cache();
return;
}
lock_cmd &= (LCK_SCOPE_MASK | LCK_TYPE_MASK | LCK_HOLD); lock_cmd &= (LCK_SCOPE_MASK | LCK_TYPE_MASK | LCK_HOLD);
/* /*
@ -693,6 +689,15 @@ void do_lock_vg(unsigned char command, unsigned char lock_flags, char *resource)
if (strncmp(resource, "P_#", 3) && !strncmp(resource, "P_", 2)) if (strncmp(resource, "P_#", 3) && !strncmp(resource, "P_", 2))
lock_cmd |= LCK_CACHE; lock_cmd |= LCK_CACHE;
DEBUGLOG("do_lock_vg: resource '%s', cmd = %s, flags = %s, memlock = %d\n",
resource, decode_full_locking_cmd(lock_cmd), decode_flags(lock_flags), memlock());
/* P_#global causes a full cache refresh */
if (!strcmp(resource, "P_" VG_GLOBAL)) {
do_refresh_cache();
return;
}
pthread_mutex_lock(&lvm_lock); pthread_mutex_lock(&lvm_lock);
switch (lock_cmd) { switch (lock_cmd) {
case LCK_VG_COMMIT: case LCK_VG_COMMIT: