From e9f9c6be26bb9c40269ebad6250e1a5b4759e74f Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 21 Jun 2012 13:43:55 +0200 Subject: [PATCH] lvmetad: check for fid existance Fail to update lvmetad with proper log error message. --- WHATS_NEW | 1 + lib/cache/lvmetad.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/WHATS_NEW b/WHATS_NEW index ed1b37fd7..f1216ff2b 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.97 - =============================== + Check for create_instance() fail in pvscan_lvmetad_single(). Use 64bit math for reserved memory and stack. Add tests for kernel_send() errors in cmirrod. Print clean_bits in pull_state, fix cut&paste typo in cmirrord. diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c index 291adfabe..d70e49051 100644 --- a/lib/cache/lvmetad.c +++ b/lib/cache/lvmetad.c @@ -691,6 +691,9 @@ int pvscan_lvmetad_single(struct cmd_context *cmd, struct device *dev) baton.fid = lvmcache_fmt(info)->ops->create_instance(lvmcache_fmt(info), &fic); + if (!baton.fid) + goto_bad; + lvmcache_foreach_mda(info, _pvscan_lvmetad_single, &baton); if (!baton.vg) lvmcache_fmt(info)->ops->destroy_instance(baton.fid); -- 2.43.5