qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] bae127: file-posix: Handle `EINVAL` fallocate


From: Peter Maydell
Subject: [Qemu-commits] [qemu/qemu] bae127: file-posix: Handle `EINVAL` fallocate return value
Date: Tue, 21 Jul 2020 12:30:33 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: bae127d4dcf6158c5042e2eee9582430839a9967
      
https://github.com/qemu/qemu/commit/bae127d4dcf6158c5042e2eee9582430839a9967
  Author: Antoine Damhet <antoine.damhet@blade-group.com>
  Date:   2020-07-21 (Tue, 21 Jul 2020)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  file-posix: Handle `EINVAL` fallocate return value

The `detect-zeroes=unmap` option may issue unaligned
`FALLOC_FL_PUNCH_HOLE` requests, raw block devices can (and will) return
`EINVAL`, qemu should then write the zeroes to the blockdev instead of
issuing an `IO_ERROR`.

The problem can be reprodced like this:

$ qemu-io -c 'write -P 0 42 1234' --image-opts 
driver=host_device,filename=/dev/loop0,detect-zeroes=unmap
write failed: Invalid argument

Signed-off-by: Antoine Damhet <antoine.damhet@blade-group.com>
Message-Id: <20200717135603.51180-1-antoine.damhet@blade-group.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 61b3043965fe3552ee2684a97e7cc809ca7a71b3
      
https://github.com/qemu/qemu/commit/61b3043965fe3552ee2684a97e7cc809ca7a71b3
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-07-21 (Tue, 21 Jul 2020)

  Changed paths:
    M block/qcow2-cluster.c

  Log Message:
  -----------
  qcow2: Implement v2 zero writes with discard if possible

qcow2 version 2 images don't support the zero flag for clusters, so for
write_zeroes requests, we return -ENOTSUP and get explicit zero buffer
writes. If the image doesn't have a backing file, we can do better: Just
discard the respective clusters.

This is relevant for 'qemu-img convert -O qcow2 -n', where qemu-img has
to assume that the existing target image may contain any data, so it has
to write zeroes. Without this patch, this results in a fully allocated
target image, even if the source image was empty.

Reported-by: Nir Soffer <nsoffer@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200721135520.72355-2-kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 4a01e27ddcb5921efd68820d05d85ba71293fea6
      
https://github.com/qemu/qemu/commit/4a01e27ddcb5921efd68820d05d85ba71293fea6
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2020-07-21 (Tue, 21 Jul 2020)

  Changed paths:
    M tests/qemu-iotests/122
    M tests/qemu-iotests/122.out

  Log Message:
  -----------
  iotests: Test sparseness for qemu-img convert -n

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20200721135520.72355-3-kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 0c1fd2f41f2f63cf3305d6d29d1acd0d960dbd36
      
https://github.com/qemu/qemu/commit/0c1fd2f41f2f63cf3305d6d29d1acd0d960dbd36
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-07-21 (Tue, 21 Jul 2020)

  Changed paths:
    M block/file-posix.c
    M block/qcow2-cluster.c
    M tests/qemu-iotests/122
    M tests/qemu-iotests/122.out

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/kevin/tags/for-upstream' into staging

Block layer patches:

- file-posix: Handle `EINVAL` fallocate return value
- qemu-img convert -n: Keep qcow2 v2 target sparse

# gpg: Signature made Tue 21 Jul 2020 16:45:28 BST
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "kwolf@redhat.com"
# 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:
  iotests: Test sparseness for qemu-img convert -n
  qcow2: Implement v2 zero writes with discard if possible
  file-posix: Handle `EINVAL` fallocate return value

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


  Commit: c8004fe6bbfc0d9c2e7b942c418a85efb3ac4b00
      
https://github.com/qemu/qemu/commit/c8004fe6bbfc0d9c2e7b942c418a85efb3ac4b00
  Author: Peter Maydell <peter.maydell@linaro.org>
  Date:   2020-07-21 (Tue, 21 Jul 2020)

  Changed paths:
    M VERSION

  Log Message:
  -----------
  Update version for v5.1.0-rc1 release

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Compare: https://github.com/qemu/qemu/compare/b50dab9ecac4...c8004fe6bbfc



reply via email to

[Prev in Thread] Current Thread [Next in Thread]