metadata: Put io before callback invocation

This allows for safe volume destruction in callback function.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
This commit is contained in:
Robert Baldyga 2019-05-13 12:12:37 +02:00
parent 0412e05260
commit c263e3e9eb

View File

@ -168,12 +168,12 @@ static void ocf_metadata_read_sb_complete(struct ocf_io *io, int error)
sizeof(context->superblock));
}
ctx_data_free(context->ctx, data);
ocf_io_put(io);
context->error = error;
context->cmpl(context);
ctx_data_free(context->ctx, data);
ocf_io_put(io);
env_free(context);
}