All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/1] Block layer patches
@ 2021-08-03 14:41 Kevin Wolf
  2021-08-03 14:41 ` [PULL 1/1] block: Fix in_flight leak in request padding error path Kevin Wolf
  2021-08-04 10:39 ` [PULL 0/1] Block layer patches Peter Maydell
  0 siblings, 2 replies; 3+ messages in thread
From: Kevin Wolf @ 2021-08-03 14:41 UTC (permalink / raw
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

The following changes since commit 7f1cab9c628a798ae2607940993771e6300e9e00:

  Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2021-08-02 17:21:50 +0100)

are available in the Git repository at:

  git://repo.or.cz/qemu/kevin.git tags/for-upstream

for you to fetch changes up to 87ab88025247b893aad5071fd38301b67be76d1a:

  block: Fix in_flight leak in request padding error path (2021-08-03 15:43:30 +0200)

----------------------------------------------------------------
Block layer patches

- Fix hang after request padding error (Windows + 512-on-4k emulation)

----------------------------------------------------------------
Kevin Wolf (1):
      block: Fix in_flight leak in request padding error path

 block/io.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PULL 1/1] block: Fix in_flight leak in request padding error path
  2021-08-03 14:41 [PULL 0/1] Block layer patches Kevin Wolf
@ 2021-08-03 14:41 ` Kevin Wolf
  2021-08-04 10:39 ` [PULL 0/1] Block layer patches Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Kevin Wolf @ 2021-08-03 14:41 UTC (permalink / raw
  To: qemu-block; +Cc: kwolf, peter.maydell, qemu-devel

When bdrv_pad_request() fails in bdrv_co_preadv_part(), bs->in_flight
has been increased, but is never decreased again. This leads to a hang
when trying to drain the block node.

This bug was observed with Windows guests which issue a request that
fully uses IOV_MAX during installation, so that when padding is
necessary (O_DIRECT with a 4k sector size block device on the host),
adding another entry causes failure.

Call bdrv_dec_in_flight() to fix this. There is a larger problem to
solve here because this request shouldn't even fail, but Windows doesn't
seem to care and with this minimal fix the installation succeeds. So
given that we're already in freeze, let's take this minimal fix for 6.1.

Fixes: 98ca45494fcd6bf0336ecd559e440b6de6ea4cd3
Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1972079
Reported-by: Qing Wang <qinwang@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Message-Id: <20210727154923.91067-1-kwolf@redhat.com>
Reviewed-by: Max Reitz <mreitz@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
---
 block/io.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/block/io.c b/block/io.c
index e0a689c584..a19942718b 100644
--- a/block/io.c
+++ b/block/io.c
@@ -1841,7 +1841,7 @@ int coroutine_fn bdrv_co_preadv_part(BdrvChild *child,
     ret = bdrv_pad_request(bs, &qiov, &qiov_offset, &offset, &bytes, &pad,
                            NULL);
     if (ret < 0) {
-        return ret;
+        goto fail;
     }
 
     tracked_request_begin(&req, bs, offset, bytes, BDRV_TRACKED_READ);
@@ -1849,10 +1849,11 @@ int coroutine_fn bdrv_co_preadv_part(BdrvChild *child,
                               bs->bl.request_alignment,
                               qiov, qiov_offset, flags);
     tracked_request_end(&req);
-    bdrv_dec_in_flight(bs);
-
     bdrv_padding_destroy(&pad);
 
+fail:
+    bdrv_dec_in_flight(bs);
+
     return ret;
 }
 
-- 
2.31.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PULL 0/1] Block layer patches
  2021-08-03 14:41 [PULL 0/1] Block layer patches Kevin Wolf
  2021-08-03 14:41 ` [PULL 1/1] block: Fix in_flight leak in request padding error path Kevin Wolf
@ 2021-08-04 10:39 ` Peter Maydell
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2021-08-04 10:39 UTC (permalink / raw
  To: Kevin Wolf; +Cc: QEMU Developers, Qemu-block

On Tue, 3 Aug 2021 at 15:41, Kevin Wolf <kwolf@redhat.com> wrote:
>
> The following changes since commit 7f1cab9c628a798ae2607940993771e6300e9e00:
>
>   Merge remote-tracking branch 'remotes/bonzini-gitlab/tags/for-upstream' into staging (2021-08-02 17:21:50 +0100)
>
> are available in the Git repository at:
>
>   git://repo.or.cz/qemu/kevin.git tags/for-upstream
>
> for you to fetch changes up to 87ab88025247b893aad5071fd38301b67be76d1a:
>
>   block: Fix in_flight leak in request padding error path (2021-08-03 15:43:30 +0200)
>
> ----------------------------------------------------------------
> Block layer patches
>
> - Fix hang after request padding error (Windows + 512-on-4k emulation)
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/6.1
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-04 10:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-08-03 14:41 [PULL 0/1] Block layer patches Kevin Wolf
2021-08-03 14:41 ` [PULL 1/1] block: Fix in_flight leak in request padding error path Kevin Wolf
2021-08-04 10:39 ` [PULL 0/1] Block layer patches Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.