[sheepdog] Call to sd_truncate()

Liu Yuan namei.unix at gmail.com
Fri Dec 13 17:58:18 CET 2013


On Fri, Dec 13, 2013 at 05:48:55PM +0100, Hadrien KOHL wrote:
> Sure,  on what commit should apply this patch?

I think current commit you are testing.

After the patch, it looks like following:

static coroutine_fn int sd_co_writev(BlockDriverState *bs, int64_t sector_num,
                        int nb_sectors, QEMUIOVector *qiov)
{
    SheepdogAIOCB *acb;
    int ret;
    int64_t offset = (sector_num + nb_sectors) * BDRV_SECTOR_SIZE;
    BDRVSheepdogState *s = bs->opaque;

    if (bs->growable && offset > s->inode.vdi_size) {
        ret = sd_truncate(bs, offset);
        if (ret < 0) {
            return ret;
        }
    }


Thanks
Yuan



More information about the sheepdog mailing list