qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH 04/10] qcow: add qcow_co_write_compressed


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH 04/10] qcow: add qcow_co_write_compressed
Date: Fri, 27 May 2016 10:45:39 -0700
User-agent: Mutt/1.6.0 (2016-04-01)

On Sat, May 14, 2016 at 03:45:52PM +0300, Denis V. Lunev wrote:
> +    qemu_co_mutex_lock(&s->lock);
> +    cluster_offset = get_cluster_offset(bs, sector_num << 9, 2, out_len, 0, 
> 0);
> +    qemu_co_mutex_unlock(&s->lock);
> +    if (cluster_offset == 0) {
> +        ret = -EIO;
> +        goto fail;
> +    }
> +    cluster_offset &= s->cluster_offset_mask;
> +
> +    iov = (struct iovec) {
> +        .iov_base   = out_buf,
> +        .iov_len    = out_len,
> +    };
> +    qemu_iovec_init_external(&hd_qiov, &iov, 1);
> +    ret = bdrv_co_pwritev(bs->file->bs, cluster_offset, out_len, &hd_qiov, 
> 0);

Not sure if this has the same race condition as the qcow2 patch.  It
seems that bdrv_getlength() is used to extend the file on a per-sector
basis.  That would mean compressed data is not packed inside sectors and
no read-write-modify race condition exists, but I haven't fully audited
get_cluster_offset().

Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]