diff options
Diffstat (limited to 'block/io.c')
-rw-r--r-- | block/io.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/block/io.c b/block/io.c index 0db1146159..1fb7afeaf0 100644 --- a/block/io.c +++ b/block/io.c @@ -841,9 +841,10 @@ static int coroutine_fn bdrv_driver_pwritev(BlockDriverState *bs, if (drv->bdrv_co_writev_flags) { ret = drv->bdrv_co_writev_flags(bs, sector_num, nb_sectors, qiov, - flags); + flags & bs->supported_write_flags); + flags &= ~bs->supported_write_flags; } else if (drv->bdrv_co_writev) { - assert(drv->supported_write_flags == 0); + assert(!bs->supported_write_flags); ret = drv->bdrv_co_writev(bs, sector_num, nb_sectors, qiov); } else { BlockAIOCB *acb; @@ -862,9 +863,7 @@ static int coroutine_fn bdrv_driver_pwritev(BlockDriverState *bs, } emulate_flags: - if (ret == 0 && (flags & BDRV_REQ_FUA) && - !(drv->supported_write_flags & BDRV_REQ_FUA)) - { + if (ret == 0 && (flags & BDRV_REQ_FUA)) { ret = bdrv_co_flush(bs); } |