]> git.proxmox.com Git - qemu.git/commitdiff
Revert "block: complete all IOs before .bdrv_truncate"
authorPeter Lieven <pl@dlhnet.de>
Mon, 11 Mar 2013 10:03:28 +0000 (11:03 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 22 Mar 2013 16:51:31 +0000 (17:51 +0100)
brdv_truncate() is also called from readv/writev commands on self-
growing file based storage. this will result in requests waiting
for theirselves to complete.

This reverts commit 9a665b2b8640e464f0a778216fc2dca8d02acf33.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block.c

diff --git a/block.c b/block.c
index 0a062c9a7cfb99aa67d5f05b45e6264cdccf26c9..22647b221aac3ac4dcb65eeaf05426d1a6784218 100644 (file)
--- a/block.c
+++ b/block.c
@@ -2487,10 +2487,6 @@ int bdrv_truncate(BlockDriverState *bs, int64_t offset)
         return -EACCES;
     if (bdrv_in_use(bs))
         return -EBUSY;
-
-    /* There better not be any in-flight IOs when we truncate the device. */
-    bdrv_drain_all();
-
     ret = drv->bdrv_truncate(bs, offset);
     if (ret == 0) {
         ret = refresh_total_sectors(bs, offset >> BDRV_SECTOR_BITS);