1. 26 10月, 2019 38 次提交
  2. 25 10月, 2019 2 次提交
    • P
      Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging · 03bf012e
      Peter Maydell 提交于
      Block layer patches:
      
      - qcow2: Fix data corruption bug that is triggered in partial cluster
        allocation with default options
      - qapi: add support for blkreplay driver
      - doc: Describe missing generic -blockdev options
      - iotests: Fix 118 when run as root
      - Minor code cleanups
      
      # gpg: Signature made Fri 25 Oct 2019 14:19:04 BST
      # gpg:                using RSA key 7F09B272C88F2FD6
      # gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]
      # Primary key fingerprint: DC3D EB15 9A9A F95D 3D74  56FE 7F09 B272 C88F 2FD6
      
      * remotes/kevin/tags/for-upstream:
        qcow2: Fix corruption bug in qcow2_detect_metadata_preallocation()
        coroutine: Add qemu_co_mutex_assert_locked()
        doc: Describe missing generic -blockdev options
        block/backup: drop dead code from backup_job_create
        blockdev: Use error_report() in hmp_commit()
        iotests: Skip read-only cases in 118 when run as root
        qapi: add support for blkreplay driver
      Signed-off-by: NPeter Maydell <peter.maydell@linaro.org>
      03bf012e
    • K
      qcow2: Fix corruption bug in qcow2_detect_metadata_preallocation() · 5e978550
      Kevin Wolf 提交于
      qcow2_detect_metadata_preallocation() calls qcow2_get_refcount() which
      requires s->lock to be taken to protect its accesses to the refcount
      table and refcount blocks. However, nothing in this code path actually
      took the lock. This could cause the same cache entry to be used by two
      requests at the same time, for different tables at different offsets,
      resulting in image corruption.
      
      As it would be preferable to base the detection on consistent data (even
      though it's just heuristics), let's take the lock not only around the
      qcow2_get_refcount() calls, but around the whole function.
      
      This patch takes the lock in qcow2_co_block_status() earlier and asserts
      in qcow2_detect_metadata_preallocation() that we hold the lock.
      
      Fixes: 69f47505
      Cc: qemu-stable@nongnu.org
      Reported-by: NMichael Weiser <michael.weiser@gmx.de>
      Signed-off-by: NKevin Wolf <kwolf@redhat.com>
      Tested-by: NMichael Weiser <michael.weiser@gmx.de>
      Reviewed-by: NMichael Weiser <michael.weiser@gmx.de>
      Reviewed-by: NVladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
      Reviewed-by: NMax Reitz <mreitz@redhat.com>
      5e978550