Block layer patches
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(-)
[PULL 1/1] block: Fix in_flight leak in request padding error path
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.
Message-Id: <[email protected]>
--- block/io.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
block/io.c +4 -3
@@ -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; }
Signature · 1 line
2.31.1
Peter Maydell
AppliedQuoted 11 lines · Kevin Wolf
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.gittags/for-upstreamfor you to fetch changes up to
87ab88025247b893aad5071fd38301b67be76d1a:
Quoted 8 lines
block: Fix
in_flightleak 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