1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +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 b0e9ba5f4b
commit 7ce425114e
3 changed files with 33 additions and 27 deletions

View File

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

View File

@ -1,5 +1,6 @@
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.
Version 1.02.58 - 22nd November 2010

View File

@ -44,11 +44,7 @@ struct lv_info {
int lock_mode;
};
/*
* FIXME: 8bit value passed here -
* so only LCK_XXX defines < 0x100 can be decoded
*/
static const char *decode_locking_cmd(unsigned char cmdl)
static const char *decode_full_locking_cmd(uint32_t cmdl)
{
static char buf[128];
const char *type;
@ -117,11 +113,20 @@ static const char *decode_locking_cmd(unsigned char cmdl)
cmdl & LCK_NONBLOCK ? "|NONBLOCK" : "",
cmdl & LCK_HOLD ? "|HOLD" : "",
cmdl & LCK_LOCAL ? "|LOCAL" : "",
cmdl & LCK_CLUSTER_VG ? "|CLUSTER_VG" : "");
cmdl & LCK_CLUSTER_VG ? "|CLUSTER_VG" : "",
cmdl & LCK_CACHE ? "|CACHE" : "");
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 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;
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);
/*
@ -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))
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);
switch (lock_cmd) {
case LCK_VG_COMMIT: