qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] c06fc7: io_uring: fix short read slow path


From: Richard Henderson
Subject: [Qemu-commits] [qemu/qemu] c06fc7: io_uring: fix short read slow path
Date: Thu, 07 Jul 2022 03:51:32 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: c06fc7ce147e57ab493bad9263f1601b8298484b
      
https://github.com/qemu/qemu/commit/c06fc7ce147e57ab493bad9263f1601b8298484b
  Author: Dominique Martinet <dominique.martinet@atmark-techno.com>
  Date:   2022-07-07 (Thu, 07 Jul 2022)

  Changed paths:
    M block/io_uring.c

  Log Message:
  -----------
  io_uring: fix short read slow path

sqeq.off here is the offset to read within the disk image, so obviously
not 'nread' (the amount we just read), but as the author meant to write
its current value incremented by the amount we just read.

Normally recent versions of linux will not issue short reads,
but it can happen so we should fix this.

This lead to weird image corruptions when short read happened

Fixes: 6663a0a33764 ("block/io_uring: implements interfaces for io_uring")
Link: https://lkml.kernel.org/r/YrrFGO4A1jS0GI0G@atmark-techno.com
Signed-off-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
Message-Id: <20220630010137.2518851-1-dominique.martinet@atmark-techno.com>
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: be6a166fde652589761cf70471bcde623e9bd72a
      
https://github.com/qemu/qemu/commit/be6a166fde652589761cf70471bcde623e9bd72a
  Author: Stefan Hajnoczi <stefanha@redhat.com>
  Date:   2022-07-07 (Thu, 07 Jul 2022)

  Changed paths:
    M block/io_uring.c

  Log Message:
  -----------
  block/io_uring: clarify that short reads can happen

Jens Axboe has confirmed that short reads are rare but can happen:
https://lore.kernel.org/io-uring/YsU%2FCGkl9ZXUI+Tj@stefanha-x1.localdomain/T/#m729963dc577d709b709c191922e98ec79d7eef54

The luring_resubmit_short_read() comment claimed they were only due to a
specific io_uring bug that was fixed in Linux commit 9d93a3f5a0c
("io_uring: punt short reads to async context"), which is wrong.
Dominique Martinet found that a btrfs bug also causes short reads. There
may be more kernel code paths that result in short reads.

Let's consider short reads fair game.

Cc: Dominique Martinet <dominique.martinet@atmark-techno.com>
Based-on: <20220630010137.2518851-1-dominique.martinet@atmark-techno.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Message-id: 20220706080341.1206476-1-stefanha@redhat.com
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>


  Commit: a74c66b1b933b37248dd4a3f70a14f779f8825ba
      
https://github.com/qemu/qemu/commit/a74c66b1b933b37248dd4a3f70a14f779f8825ba
  Author: Richard Henderson <richard.henderson@linaro.org>
  Date:   2022-07-07 (Thu, 07 Jul 2022)

  Changed paths:
    M block/io_uring.c

  Log Message:
  -----------
  Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into 
staging

Pull request

# -----BEGIN PGP SIGNATURE-----
#
# iQEzBAABCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmLGlXYACgkQnKSrs4Gr
# c8jfNwf/fFfx4mPFwdnud9cseb9jFU44/RWJ2rJlYerbHIUUNvW0vAv1nGjuVVWT
# DeHxG2pkHPJQ5u4y/oivq4CCGGQ/Ukx/IEqJsnXEpWyKHosHJHlBrePt+/x+uygA
# RUOfReSq4gsK1FIcluuO/wnBzgREXL6lBsyIHtvG57hYSSESS10fCdRXBPJJMBcF
# pI8LpEgID5KuqPjXoO/Cv4qOXpOpO8540b8mzHP8wY1tYbBP9H4uqO1MJ/OFz8GU
# wDeRJEa66o9kwV7oym8T+KdZHR1f+Yfk0o1WmtfUgECJkM/8aUTvNog5SVeaHKqV
# 0ZQ4L6j8cprKXl9Ui+LXFp2YMMXV9g==
# =IjWZ
# -----END PGP SIGNATURE-----
# gpg: Signature made Thu 07 Jul 2022 01:42:38 PM +0530
# gpg:                using RSA key 8695A8BFD3F97CDAAC35775A9CA4ABB381AB73C8
# gpg: Good signature from "Stefan Hajnoczi <stefanha@redhat.com>" [full]
# gpg:                 aka "Stefan Hajnoczi <stefanha@gmail.com>" [full]

* tag 'block-pull-request' of https://gitlab.com/stefanha/qemu:
  block/io_uring: clarify that short reads can happen
  io_uring: fix short read slow path

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


Compare: https://github.com/qemu/qemu/compare/8e9398e3b1a8...a74c66b1b933



reply via email to

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