From: Hanna Reitz <hreitz@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org
Subject: Re: [PATCH] file-posix: Fix alignment after reopen changing O_DIRECT
Date: Thu, 4 Nov 2021 14:32:35 +0100 [thread overview]
Message-ID: <0d682c41-8ac3-28b7-5cf6-aa8377ae3d65@redhat.com> (raw)
In-Reply-To: <20211104113109.56336-1-kwolf@redhat.com>
On 04.11.21 12:31, Kevin Wolf wrote:
> At the end of a reopen, we already call bdrv_refresh_limits(), which
> should update bs->request_alignment according to the new file
> descriptor. However, raw_probe_alignment() relies on s->needs_alignment
> and just uses 1 if it isn't set. We neglected to update this field, so
> starting with cache=writeback and then reopening with cache=none means
> that we get an incorrect bs->request_alignment == 1 and unaligned
> requests fail instead of being automatically aligned.
>
> Fix this by recalculating s->needs_alignment in raw_refresh_limits()
> before calling raw_probe_alignment().
>
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
> block/file-posix.c | 20 ++++++++++++++++----
> tests/qemu-iotests/142 | 22 ++++++++++++++++++++++
> tests/qemu-iotests/142.out | 15 +++++++++++++++
> 3 files changed, 53 insertions(+), 4 deletions(-)
Reviewed-by: Hanna Reitz <hreitz@redhat.com>
next prev parent reply other threads:[~2021-11-04 13:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-04 11:31 [PATCH] file-posix: Fix alignment after reopen changing O_DIRECT Kevin Wolf
2021-11-04 13:32 ` Hanna Reitz [this message]
2021-11-04 14:20 ` Stefano Garzarella
2021-11-04 14:47 ` Kevin Wolf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0d682c41-8ac3-28b7-5cf6-aa8377ae3d65@redhat.com \
--to=hreitz@redhat.com \
--cc=kwolf@redhat.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).