diff options
author | David Teigland <teigland@redhat.com> | 2015-11-16 15:08:52 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2015-11-16 15:13:26 -0600 |
commit | 7d1c9e1d5a11e7e06c52036c380dd51a2c761f66 (patch) | |
tree | 780e881fdf1c09e1c76a95a4f3f855df028d98d9 | |
parent | 68c386cce71f5bf876cc9ed754d901f1ca9daeed (diff) | |
download | lvm2-7d1c9e1d5a11e7e06c52036c380dd51a2c761f66.tar.gz |
lvmetad: fix some error logging
For some errors old_meta may not be set, so
check before logging it.
-rw-r--r-- | daemons/lvmetad/lvmetad-core.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c index 623e1dfb2..2ceaa0251 100644 --- a/daemons/lvmetad/lvmetad-core.c +++ b/daemons/lvmetad/lvmetad-core.c @@ -1603,7 +1603,8 @@ static int _update_metadata(lvmetad_state *s, const char *arg_name, const char * if (pvid && needs_repair) { 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); - DEBUGLOG_cft(s, "OLD: ", old_meta->root); + if (old_meta) + DEBUGLOG_cft(s, "OLD: ", old_meta->root); DEBUGLOG_cft(s, "NEW: ", new_metadata); retval = 0; goto out; @@ -1615,7 +1616,8 @@ static int _update_metadata(lvmetad_state *s, const char *arg_name, const char * if (!pvid && needs_repair) { ERROR(s, "update_metadata inconsistent with cache for vgid %s and name %s", arg_vgid, arg_name); - DEBUGLOG_cft(s, "OLD: ", old_meta->root); + if (old_meta) + DEBUGLOG_cft(s, "OLD: ", old_meta->root); DEBUGLOG_cft(s, "NEW: ", new_metadata); abort_daemon = 1; retval = 0; |