summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2017-08-28 13:37:51 -0500
committerDavid Teigland <teigland@redhat.com>2017-10-16 11:17:12 -0500
commit03f08a8dea3dd86235fe345808ef38328ae59dca (patch)
tree72283e4d6da55394c87f1dd851ff5c1c72d157f5
parent22152304289cbf8266b1dafa306fd25fa3b19714 (diff)
downloadlvm2-03f08a8dea3dd86235fe345808ef38328ae59dca.tar.gz
lvmetad_vg_lookup: use fid ref_count to fix unwanted free
-rw-r--r--lib/cache/lvmetad.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c
index a8827ac6e..47eb5f62a 100644
--- a/lib/cache/lvmetad.c
+++ b/lib/cache/lvmetad.c
@@ -1097,7 +1097,9 @@ struct volume_group *lvmetad_vg_lookup(struct cmd_context *cmd, const char *vgna
vg = NULL;
goto out;
}
+ fid->ref_count++;
release_vg(vg);
+ fid->ref_count--;
fmt->ops->destroy_instance(fid);
vg = vg2;
fid = vg2->fid;