1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 20:25:52 +03:00

lvmetad: fix some error logging

For some errors old_meta may not be set, so
check before logging it.
This commit is contained in:
David Teigland 2015-11-16 15:08:52 -06:00
parent 68c386cce7
commit 7d1c9e1d5a

View File

@ -1603,6 +1603,7 @@ static int _update_metadata(lvmetad_state *s, const char *arg_name, const char *
if (pvid && needs_repair) { if (pvid && needs_repair) {
ERROR(s, "update_metadata ignore inconsistent metadata on PV %s seqno %d for %s %s seqno %d", ERROR(s, "update_metadata ignore inconsistent metadata on PV %s seqno %d for %s %s seqno %d",
pvid, new_seq, arg_vgid, arg_name, old_seq); pvid, new_seq, arg_vgid, arg_name, old_seq);
if (old_meta)
DEBUGLOG_cft(s, "OLD: ", old_meta->root); DEBUGLOG_cft(s, "OLD: ", old_meta->root);
DEBUGLOG_cft(s, "NEW: ", new_metadata); DEBUGLOG_cft(s, "NEW: ", new_metadata);
retval = 0; retval = 0;
@ -1615,6 +1616,7 @@ static int _update_metadata(lvmetad_state *s, const char *arg_name, const char *
if (!pvid && needs_repair) { if (!pvid && needs_repair) {
ERROR(s, "update_metadata inconsistent with cache for vgid %s and name %s", ERROR(s, "update_metadata inconsistent with cache for vgid %s and name %s",
arg_vgid, arg_name); arg_vgid, arg_name);
if (old_meta)
DEBUGLOG_cft(s, "OLD: ", old_meta->root); DEBUGLOG_cft(s, "OLD: ", old_meta->root);
DEBUGLOG_cft(s, "NEW: ", new_metadata); DEBUGLOG_cft(s, "NEW: ", new_metadata);
abort_daemon = 1; abort_daemon = 1;