Merge pull request #624 from beef9999/fix-completion-order

fix volume_close completion order
This commit is contained in:
Robert Baldyga 2021-12-22 12:38:02 +01:00 committed by GitHub
commit 04da4fd4ef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -323,7 +323,6 @@ static void ocf_volume_close_end(void *ctx)
env_completion *cmpl = ctx; env_completion *cmpl = ctx;
env_completion_complete(cmpl); env_completion_complete(cmpl);
env_completion_destroy(cmpl);
} }
void ocf_volume_close(ocf_volume_t volume) void ocf_volume_close(ocf_volume_t volume)
@ -338,6 +337,7 @@ void ocf_volume_close(ocf_volume_t volume)
ocf_refcnt_register_zero_cb(&volume->refcnt, ocf_volume_close_end, ocf_refcnt_register_zero_cb(&volume->refcnt, ocf_volume_close_end,
&cmpl); &cmpl);
env_completion_wait(&cmpl); env_completion_wait(&cmpl);
env_completion_destroy(&cmpl);
volume->type->properties->ops.close(volume); volume->type->properties->ops.close(volume);
volume->opened = false; volume->opened = false;