On Wed, Sep 25, 2013 at 05:02:55PM -0400, Jeff Cody wrote:
> +/* Perform a log write, and then immediately flush the entire log */
> +int vhdx_log_write_and_flush(BlockDriverState *bs, BDRVVHDXState *s,
> +                             void *data, uint32_t length, uint64_t offset)
> +{
> +    int ret = 0;
> +    VHDXLogSequence logs = { .valid = true,
> +                             .count = 1,
> +                             .hdr = { 0 } };
> +
> +
> +    ret = vhdx_log_write(bs, s, data, length, offset);
> +    if (ret < 0) {
> +        goto exit;
> +    }
> +    logs.log = s->log;

I don't see a bdrv_co_flush() that ensures the log has been persisted
before we begin applying log entries to the file.

Without the flush there is no guarantee that the log entries will be
accessible in case of power failure during vhdx_log_write_and_flush().

Stefan

Reply via email to