Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=401c9aba4a1d37d2…
Commit: 401c9aba4a1d37d2bb05467e8860876929db9a8c
Parent: 3e8dbfaecf5168ff8717e3eebabee06c27b44fe6
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Dec 14 14:06:33 2012 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sat Dec 15 17:23:27 2012 +0100
pv_read: add missing check for valid info
If the lvmcache_info_from_pvid() fails to find valid
info, invoke the lookup by dev, and only in this case
call lvmcache_info_from_pvid() again.
Also check for the result of info and return
error directly, so the NULL is not passed
to lvmcache_get_label().
---
WHATS_NEW | 1 +
lib/metadata/metadata.c | 7 ++++++-
2 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index b9cdfa7..106bee4 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Check lvmcache_info_from_pvid and recall only when needed in _pv_read.
Check for memory failure of dm_config_write_node() in lvmetad.
Fix socket leak on error path in lvmetad's handle_connect.
Check for failing id_read_format() in _pv_populate_lvmcache.
diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c
index 549a356..807d06a 100644
--- a/lib/metadata/metadata.c
+++ b/lib/metadata/metadata.c
@@ -3633,8 +3633,13 @@ static struct physical_volume *_pv_read(struct cmd_context *cmd,
pv_name);
return NULL;
}
+ if (!(info = lvmcache_info_from_pvid(dev->pvid, 0))) {
+ if (warnings)
+ log_error("No cache info in lvmetad cache for %s.",
+ pv_name);
+ return NULL;
+ }
}
- info = lvmcache_info_from_pvid(dev->pvid, 0);
label = lvmcache_get_label(info);
} else {
if (!(label_read(dev, &label, UINT64_C(0)))) {
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=740ab81d03b12860…
Commit: 740ab81d03b1286096d9f8b35be15d54493db52f
Parent: 575c4ed96412edf513dbd0263983520a15b3b8bc
Author: Zdenek Kabelac <zkabelac(a)redhat.com>
AuthorDate: Fri Dec 14 13:57:01 2012 +0100
Committer: Zdenek Kabelac <zkabelac(a)redhat.com>
CommitterDate: Sat Dec 15 17:22:48 2012 +0100
log: move abort past syslog
When the abort_on_internal_errors is enabled, we aborted prior
the syslog logging output.
Since such fatal error gets level _LOG_FATAL it should
not be blocked by debug_level() check so lets move it further,
to get abort error logged also via syslog.
---
WHATS_NEW | 1 +
lib/log/log.c | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/WHATS_NEW b/WHATS_NEW
index 697e4d2..249db0b 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.99 -
===================================
+ Log output also to syslog when abort_on_internal_error is set.
Add LV snapshot support to liblvm and python-lvm.
Avoid a global lock in pvs when lvmetad is in use.
Fix crash in pvscan --cache -aay triggered by non-mda PV.
diff --git a/lib/log/log.c b/lib/log/log.c
index d50cb4a..3c357f1 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -344,9 +344,6 @@ void print_log(int level, const char *file, int line, int dm_errno,
va_end(ap);
}
- if (fatal_internal_error)
- abort();
-
if (level > debug_level())
return;
@@ -368,6 +365,9 @@ void print_log(int level, const char *file, int line, int dm_errno,
va_end(ap);
}
+ if (fatal_internal_error)
+ abort();
+
/* FIXME This code is unfinished - pre-extend & condense. */
if (!_already_logging && _log_direct && critical_section()) {
_already_logging = 1;