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-23 15:17:33 -0500
commit65f2448caff845f4dcef862efecc38a421b0850a (patch)
treeb0c7cade32f239ce258fed8d171753885058bf35
parentc578032f3751cabc927d027d41a6ca949cdbc21d (diff)
downloadlvm2-65f2448caff845f4dcef862efecc38a421b0850a.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 a048523cb..5d9cda0ff 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;