qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 13a028: block/file-posix: Fix return value tr


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] 13a028: block/file-posix: Fix return value translation for...
Date: Tue, 02 Nov 2021 23:27:20 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 13a028336f2c05e7ff47dfdaf30dfac7f4883e80
      
https://github.com/qemu/qemu/commit/13a028336f2c05e7ff47dfdaf30dfac7f4883e80
  Author: Ari Sundholm <ari@tuxera.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M block/file-posix.c

  Log Message:
  -----------
  block/file-posix: Fix return value translation for AIO discards

AIO discards regressed as a result of the following commit:
        0dfc7af2 block/file-posix: Optimize for macOS

When trying to run blkdiscard within a Linux guest, the request would
fail, with some errors in dmesg:

---- [ snip ] ----
[    4.010070] sd 2:0:0:0: [sda] tag#0 FAILED Result: hostbyte=DID_OK
driverbyte=DRIVER_SENSE
[    4.011061] sd 2:0:0:0: [sda] tag#0 Sense Key : Aborted Command
[current]
[    4.011061] sd 2:0:0:0: [sda] tag#0 Add. Sense: I/O process
terminated
[    4.011061] sd 2:0:0:0: [sda] tag#0 CDB: Unmap/Read sub-channel 42
00 00 00 00 00 00 00 18 00
[    4.011061] blk_update_request: I/O error, dev sda, sector 0
---- [ snip ] ----

This turns out to be a result of a flaw in changes to the error value
translation logic in handle_aiocb_discard(). The default return value
may be left untranslated in some configurations, and the wrong variable
is used in one translation.

Fix both issues.

Fixes: 0dfc7af2b28 ("block/file-posix: Optimize for macOS")
Cc: qemu-stable@nongnu.org
Signed-off-by: Ari Sundholm <ari@tuxera.com>
Signed-off-by: Emil Karlson <jkarlson@tuxera.com>
Reviewed-by: Akihiko Odaki <akihiko.odaki@gmail.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Message-Id: <20211019110954.4170931-1-ari@tuxera.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: bfb8aa6d583b09378dcdb85d40c7951e44acd09f
      
https://github.com/qemu/qemu/commit/bfb8aa6d583b09378dcdb85d40c7951e44acd09f
  Author: Kevin Wolf <kwolf@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M block.c
    M tests/qemu-iotests/085
    M tests/qemu-iotests/085.out

  Log Message:
  -----------
  block: Fail gracefully when blockdev-snapshot creates loops

Using blockdev-snapshot to append a node as an overlay to itself, or to
any of its parents, causes crashes. Catch the condition and return an
error for these cases instead.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1824363
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20211018134714.48438-1-kwolf@redhat.com>
Reviewed-by: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 0347a8fd4c3faaedf119be04c197804be40a384b
      
https://github.com/qemu/qemu/commit/0347a8fd4c3faaedf119be04c197804be40a384b
  Author: Peter Lieven <pl@kamp.de>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M block/rbd.c

  Log Message:
  -----------
  block/rbd: implement bdrv_co_block_status

the qemu rbd driver currently lacks support for bdrv_co_block_status.
This results mainly in incorrect progress during block operations (e.g.
qemu-img convert with an rbd image as source).

This patch utilizes the rbd_diff_iterate2 call from librbd to detect
allocated and unallocated (all zero areas).

To avoid querying the ceph OSDs for the answer this is only done if
the image has the fast-diff feature which depends on the object-map and
exclusive-lock features. In this case it is guaranteed that the information
is present in memory in the librbd client and thus very fast.

If fast-diff is not available all areas are reported to be allocated
which is the current behaviour if bdrv_co_block_status is not implemented.

Signed-off-by: Peter Lieven <pl@kamp.de>
Message-Id: <20211012152231.24868-1-pl@kamp.de>
Reviewed-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 46e018e9b741731842b93ce23a86fad60445969b
      
https://github.com/qemu/qemu/commit/46e018e9b741731842b93ce23a86fad60445969b
  Author: Samuel Thibault <samuel.thibault@ens-lyon.org>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M hw/ide/core.c

  Log Message:
  -----------
  ide: Cap LBA28 capacity announcement to 2^28-1

The LBA28 capacity (at offsets 60/61 of identification) is supposed to
express the maximum size supported by LBA28 commands. If the device is
larger than this, we have to cap it to 2^28-1.

At least NetBSD happens to be using this value to determine whether to use
LBA28 or LBA48 for its commands, using LBA28 for sectors that don't need
LBA48. This commit thus fixes NetBSD access to disks larger than 128GiB.

Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Message-Id: <20210824104344.3878849-1-samuel.thibault@ens-lyon.org>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 304332039014679b809f606e2f227ee0fc43a451
      
https://github.com/qemu/qemu/commit/304332039014679b809f606e2f227ee0fc43a451
  Author: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M block/export/fuse.c

  Log Message:
  -----------
  block/export/fuse.c: fix musl build

Include linux/falloc.h if CONFIG_FALLOCATE_ZERO_RANGE is defined to fix
https://gitlab.com/qemu-project/qemu/-/commit/50482fda98bd62e072c30b7ea73c985c4e9d9bbb
and avoid the following build failure on musl:

../block/export/fuse.c: In function 'fuse_fallocate':
../block/export/fuse.c:643:21: error: 'FALLOC_FL_ZERO_RANGE' undeclared (first 
use in this function)
  643 |     else if (mode & FALLOC_FL_ZERO_RANGE) {
      |                     ^~~~~~~~~~~~~~~~~~~~

Fixes:
 - 
http://autobuild.buildroot.org/results/be24433a429fda681fb66698160132c1c99bc53b

Fixes: 50482fda98b ("block/export/fuse.c: fix musl build")
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Message-Id: <20211022095209.1319671-1-fontaine.fabrice@gmail.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 684960d46267d6e6443b39ee98b3a95632ba8dc6
      
https://github.com/qemu/qemu/commit/684960d46267d6e6443b39ee98b3a95632ba8dc6
  Author: Stefano Garzarella <sgarzare@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M block/file-posix.c
    M qapi/block-core.json

  Log Message:
  -----------
  file-posix: add `aio-max-batch` option

Commit d7ddd0a161 ("linux-aio: limit the batch size using
`aio-max-batch` parameter") added a way to limit the batch size
of Linux AIO backend for the entire AIO context.

The same AIO context can be shared by multiple devices, so
latency-sensitive devices may want to limit the batch size even
more to avoid increasing latency.

For this reason we add the `aio-max-batch` option to the file
backend, which will be used by the next commits to limit the size of
batches including requests generated by this device.

Suggested-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20211026162346.253081-2-sgarzare@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 512da211010700cdbfaab45c8980ca88958a4ab8
      
https://github.com/qemu/qemu/commit/512da211010700cdbfaab45c8980ca88958a4ab8
  Author: Stefano Garzarella <sgarzare@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M block/file-posix.c
    M block/linux-aio.c
    M include/block/raw-aio.h

  Log Message:
  -----------
  linux-aio: add `dev_max_batch` parameter to laio_co_submit()

This new parameter can be used by block devices to limit the
Linux AIO batch size more than the limit set by the AIO context.

file-posix backend supports this, passing its `aio-max-batch` option
previously added.

Add an helper function to calculate the maximum batch size.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20211026162346.253081-3-sgarzare@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 68d7946648a5c364a4df187804d37f09a318b50f
      
https://github.com/qemu/qemu/commit/68d7946648a5c364a4df187804d37f09a318b50f
  Author: Stefano Garzarella <sgarzare@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M block/file-posix.c
    M block/linux-aio.c
    M include/block/raw-aio.h

  Log Message:
  -----------
  linux-aio: add `dev_max_batch` parameter to laio_io_unplug()

Between the submission of a request and the unplug, other devices
with larger limits may have been queued new requests without flushing
the batch.

Using the new `dev_max_batch` parameter, laio_io_unplug() can check
if the batch exceeds the device limit to flush the current batch.

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Kevin Wolf <kwolf@redhat.com>
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20211026162346.253081-4-sgarzare@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 73d4a11300ee87e04f93fab4380b80379e792a06
      
https://github.com/qemu/qemu/commit/73d4a11300ee87e04f93fab4380b80379e792a06
  Author: Hanna Reitz <hreitz@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M block/block-backend.c

  Log Message:
  -----------
  block-backend: Silence clang -m32 compiler warning

Similarly to e7e588d432d31ecebc26358e47201dd108db964c, there is a
warning in block/block-backend.c that qiov->size <= INT64_MAX is always
true on machines where size_t is narrower than a uint64_t.  In said
commit, we silenced this warning by casting to uint64_t.

The commit introducing this warning here
(a93d81c84afa717b0a1a6947524d8d1fbfd6bbf5) anticipated it and so tried
to address it the same way.  However, it only did so in one of two
places where this comparison occurs, and so we still need to fix up the
other one.

Fixes: a93d81c84afa717b0a1a6947524d8d1fbfd6bbf5
       ("block-backend: convert blk_aio_ functions to int64_t bytes
       paramter")
Signed-off-by: Hanna Reitz <hreitz@redhat.com>
Message-Id: <20211026090745.30800-1-hreitz@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 4a613bd86256543b9735307674a84e167a585687
      
https://github.com/qemu/qemu/commit/4a613bd86256543b9735307674a84e167a585687
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Automatically free qemu_memalign() with QEMU_AUTO_VFREE

Since commit 4d324c0bf65 ("introduce QEMU_AUTO_VFREE") buffers
allocated by qemu_memalign() can automatically freed when using
the QEMU_AUTO_VFREE macro. Use it to simplify a bit.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211006164931.172349-2-philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 53cedeaaee9d585bd07eb921fa5557c64531f69b
      
https://github.com/qemu/qemu/commit/53cedeaaee9d585bd07eb921fa5557c64531f69b
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M block/nvme.c
    M block/trace-events

  Log Message:
  -----------
  block/nvme: Display CQ/SQ pointer in nvme_free_queue_pair()

For debugging purpose it is helpful to know the CQ/SQ pointers.
We already have a trace event in nvme_free_queue_pair(), extend
it to report these pointer addresses.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211006164931.172349-3-philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: a8951438946d72d74c9bdbdb38fce95aa2973a88
      
https://github.com/qemu/qemu/commit/a8951438946d72d74c9bdbdb38fce95aa2973a88
  Author: Philippe Mathieu-Daudé <philmd@redhat.com>
  Date:   2021-11-02 (Tue, 02 Nov 2021)

  Changed paths:
    M block/nvme.c

  Log Message:
  -----------
  block/nvme: Extract nvme_free_queue() from nvme_free_queue_pair()

Instead of duplicating code, extract the common helper to free
a single queue.

Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Message-Id: <20211006164931.172349-4-philmd@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>


  Commit: 741bdeb1d5a4024a2c54c6abb2de493a27b61953
      
https://github.com/qemu/qemu/commit/741bdeb1d5a4024a2c54c6abb2de493a27b61953
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2021-11-03 (Wed, 03 Nov 2021)

  Changed paths:
    M block.c
    M block/block-backend.c
    M block/export/fuse.c
    M block/file-posix.c
    M block/linux-aio.c
    M block/nvme.c
    M block/rbd.c
    M block/trace-events
    M hw/ide/core.c
    M include/block/raw-aio.h
    M qapi/block-core.json
    M tests/qemu-iotests/085
    M tests/qemu-iotests/085.out

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

Block layer patches

- Fail gracefully when blockdev-snapshot creates loops
- ide: Fix IDENTIFY DEVICE for disks > 128 GiB
- file-posix: Fix return value translation for AIO discards
- file-posix: add 'aio-max-batch' option
- rbd: implement bdrv_co_block_status
- Code cleanups and build fixes

# gpg: Signature made Tue 02 Nov 2021 12:04:02 PM EDT
# gpg:                using RSA key DC3DEB159A9AF95D3D7456FE7F09B272C88F2FD6
# gpg:                issuer "kwolf@redhat.com"
# gpg: Good signature from "Kevin Wolf <kwolf@redhat.com>" [full]

* remotes/kwolf/tags/for-upstream:
  block/nvme: Extract nvme_free_queue() from nvme_free_queue_pair()
  block/nvme: Display CQ/SQ pointer in nvme_free_queue_pair()
  block/nvme: Automatically free qemu_memalign() with QEMU_AUTO_VFREE
  block-backend: Silence clang -m32 compiler warning
  linux-aio: add `dev_max_batch` parameter to laio_io_unplug()
  linux-aio: add `dev_max_batch` parameter to laio_co_submit()
  file-posix: add `aio-max-batch` option
  block/export/fuse.c: fix musl build
  ide: Cap LBA28 capacity announcement to 2^28-1
  block/rbd: implement bdrv_co_block_status
  block: Fail gracefully when blockdev-snapshot creates loops
  block/file-posix: Fix return value translation for AIO discards

Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Compare: https://github.com/qemu/qemu/compare/22d5760cb43e...741bdeb1d5a4



reply via email to

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