[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 03/37] block: complete all IOs before .bdrv_truncate
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 03/37] block: complete all IOs before .bdrv_truncate |
Date: |
Tue, 2 Apr 2013 16:45:08 -0500 |
From: Peter Lieven <address@hidden>
bdrv_truncate() invalidates the bdrv_check_request() result for
in-flight requests, so there should better be none.
Cc: address@hidden
Signed-off-by: Peter Lieven <address@hidden>
Reported-by: Kevin Wolf <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Signed-off-by: Kevin Wolf <address@hidden>
(cherry picked from commit 9a665b2b8640e464f0a778216fc2dca8d02acf33)
Signed-off-by: Michael Roth <address@hidden>
---
block.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/block.c b/block.c
index 50dab8e..11f162b 100644
--- a/block.c
+++ b/block.c
@@ -2427,6 +2427,10 @@ 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);
--
1.7.9.5
- [Qemu-devel] Patch Round-up for stable 1.4.1, freeze next Tuesday, Michael Roth, 2013/04/02
- [Qemu-devel] [PATCH 01/37] target-ppc: Fix "G2leGP3" PVR, Michael Roth, 2013/04/02
- [Qemu-devel] [PATCH 02/37] coroutine: trim down nesting level in perf_nesting test, Michael Roth, 2013/04/02
- [Qemu-devel] [PATCH 03/37] block: complete all IOs before .bdrv_truncate,
Michael Roth <=
- [Qemu-devel] [PATCH 04/37] tap: forbid creating multiqueue tap when hub is used, Michael Roth, 2013/04/02
- [Qemu-devel] [PATCH 05/37] qemu-char.c: fix waiting for telnet connection message, Michael Roth, 2013/04/02
- [Qemu-devel] [PATCH 06/37] net: reduce the unnecessary memory allocation of multiqueue, Michael Roth, 2013/04/02
- [Qemu-devel] [PATCH 08/37] vga: fix byteswapping., Michael Roth, 2013/04/02
- [Qemu-devel] [PATCH 09/37] qmp: netdev_add is like -netdev, not -net, fix documentation, Michael Roth, 2013/04/02
- [Qemu-devel] [PATCH 07/37] help: add docs for multiqueue tap options, Michael Roth, 2013/04/02
- [Qemu-devel] [PATCH 10/37] qemu-ga: make guest-sync-delimited available during fsfreeze, Michael Roth, 2013/04/02
- [Qemu-devel] [PATCH 11/37] scsi-disk: handle io_canceled uniformly and correctly, Michael Roth, 2013/04/02
- [Qemu-devel] [PATCH 12/37] iscsi: look for pkg-config file too, Michael Roth, 2013/04/02
- [Qemu-devel] [PATCH 13/37] scsi: do not call scsi_read_data/scsi_write_data for a canceled request, Michael Roth, 2013/04/02