1. 08 5月, 2012 1 次提交
    • K
      qcow2: Limit COW to where it's needed · 54e68143
      Kevin Wolf 提交于
      This fixes a regression introduced in commit 250196f1. The bug leads to
      data corruption, found during an Autotest run with a Fedora 8 guest.
      
      Consider a write request whose first part is covered by an already
      allocated cluster, but additional clusters need to be newly allocated.
      When counting the number of clusters to allocate, the qcow2 code would
      decide to do COW for all remaining clusters of the write request, even
      if some of them are already allocated.
      
      If during this COW operation another write request is issued that touches
      the same cluster, it will still refer to the old cluster. When the COW
      completes, the first request will update the L2 table and the second
      write request will be lost. Note that the requests need not overlap, it's
      enough for them to touch the same cluster.
      
      This patch ensures that only clusters that really require COW are
      considered for allocation. In this case any other request writing to the
      same cluster will be an allocating write and gets serialised.
      Reported-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Tested-by: NMarcelo Tosatti <mtosatti@redhat.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      54e68143
  2. 03 5月, 2012 2 次提交
  3. 20 4月, 2012 7 次提交
  4. 19 4月, 2012 1 次提交
  5. 05 4月, 2012 1 次提交
  6. 12 3月, 2012 3 次提交
  7. 05 12月, 2011 2 次提交
    • S
      qcow2: avoid reentrant bdrv_read() in copy_sectors() · aef4acb6
      Stefan Hajnoczi 提交于
      A BlockDriverState should not issue requests on itself through the
      public block layer interface.  Nested, or reentrant, requests are
      problematic because they do I/O throttling and request tracking twice.
      
      Features like block layer copy-on-read use request tracking to avoid
      race conditions between concurrent requests.  The reentrant request will
      have to "wait" for its parent request to complete.  But the parent is
      waiting for the reentrant request to make progress so we have reached
      deadlock.
      
      The solution is for block drivers to avoid the public block layer
      interfaces for reentrant requests.   Instead they should call their own
      internal functions if they wish to perform reentrant requests.
      
      This is also a good opportunity to make copy_sectors() a true
      coroutine_fn.  That means calling bdrv_co_writev() instead of
      bdrv_write().  Behavior is unchanged but we're being explicit that this
      executes in coroutine context.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      aef4acb6
    • K
      qcow2: Unlock during COW · 1b9f1491
      Kevin Wolf 提交于
      Unlocking during COW allows for more parallelism. One change it requires is
      that buffers are dynamically allocated instead of just using a per-image
      buffer.
      
      While touching the code, drop the synchronous qcow2_read() function and replace
      it by a bdrv_read() call.
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      1b9f1491
  8. 21 10月, 2011 1 次提交
  9. 12 9月, 2011 3 次提交
  10. 25 8月, 2011 1 次提交
  11. 23 8月, 2011 1 次提交
  12. 21 8月, 2011 1 次提交
  13. 02 8月, 2011 1 次提交
  14. 15 6月, 2011 1 次提交
  15. 08 6月, 2011 1 次提交
  16. 10 2月, 2011 2 次提交
  17. 31 1月, 2011 1 次提交
  18. 24 1月, 2011 3 次提交
  19. 17 12月, 2010 1 次提交
  20. 04 11月, 2010 1 次提交
  21. 22 10月, 2010 1 次提交
    • S
      qcow2: Support exact L1 table growth · 72893756
      Stefan Hajnoczi 提交于
      The L1 table grow operation includes a size calculation that bumps up
      the new L1 table size in order to anticipate the size needs of vmstate
      data.  This helps reduce the number of times that the L1 table has to be
      grown when vmstate data is appended.
      
      This size overhead is not necessary during image creation,
      bdrv_truncate(), or snapshot goto operations.  In fact, existing
      qemu-iotests that exercise table growth are no longer able to trigger it
      because image creation preallocates an L1 table that is too large after
      changes to qcow_create2().
      
      This patch keeps the size calculation but also adds exact growth for
      callers that do not want to inflate the L1 table size unnecessarily.
      Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      72893756
  22. 21 9月, 2010 3 次提交
  23. 08 9月, 2010 1 次提交