qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 3/3] iscsi_truncate: ensure there are no requests in flight
@ 2013-03-11 10:05 Peter Lieven
  2013-03-11 10:16 ` Paolo Bonzini
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Lieven @ 2013-03-11 10:05 UTC (permalink / raw)
  To: qemu-devel@nongnu.org
  Cc: Kevin Wolf, Paolo Bonzini, Jeff Cody, Anthony Liguori

ensure that there are no pending I/Os before calling
the sync readcapacity commands. the block_resize monitor
command will also flush all I/O, but double check in
case iscsi_truncate() is called from elsewhere in the
future.

Signed-off-by: Peter Lieven <pl@kamp.de>
---
  block/iscsi.c |    4 ++++
  1 file changed, 4 insertions(+)

diff --git a/block/iscsi.c b/block/iscsi.c
index 3d52921..de20d53 100644
--- a/block/iscsi.c
+++ b/block/iscsi.c
@@ -1167,6 +1167,10 @@ static int iscsi_truncate(BlockDriverState *bs, int64_t offset)
          return -ENOTSUP;
      }

+    /* ensure all async requests are completed before executing
+     * a sync readcapacity */
+    bdrv_drain_all();
+
      if ((ret = iscsi_readcapacity_sync(iscsilun)) != 0) {
          return ret;
      }
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-03-19  9:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-03-11 10:05 [Qemu-devel] [PATCH 3/3] iscsi_truncate: ensure there are no requests in flight Peter Lieven
2013-03-11 10:16 ` Paolo Bonzini
2013-03-11 10:19   ` Peter Lieven
2013-03-11 11:44     ` Paolo Bonzini
2013-03-11 11:52       ` Peter Lieven
2013-03-11 13:00         ` Paolo Bonzini
2013-03-13  9:31         ` Kevin Wolf
2013-03-13 10:15           ` Paolo Bonzini
2013-03-19  7:29   ` Peter Lieven
2013-03-19  9:44     ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).