From: Hanna Czenczek <hreitz@redhat.com>
To: Naohiro Aota <nao.aota@gmail.com>, qemu-block@nongnu.org
Cc: qemu-devel@nongnu.org, Kevin Wolf <kwolf@redhat.com>,
Sam Li <faithilikerun@gmail.com>,
Stefan Hajnoczi <stefanha@redhat.com>,
Damien Le Moal <Damien.LeMoal@wdc.com>,
Naohiro Aota <naohiro.aota@wdc.com>
Subject: Re: [PATCH] file-posix: fix over-writing of returning zone_append offset
Date: Mon, 6 Nov 2023 16:16:27 +0100 [thread overview]
Message-ID: <499f3f71-5c3e-4a82-a89c-f6d32aaa837b@redhat.com> (raw)
In-Reply-To: <20231030073853.2601162-1-naohiro.aota@wdc.com>
On 30.10.23 08:38, Naohiro Aota wrote:
> raw_co_zone_append() sets "s->offset" where "BDRVRawState *s". This pointer
> is used later at raw_co_prw() to save the block address where the data is
> written.
>
> When multiple IOs are on-going at the same time, a later IO's
> raw_co_zone_append() call over-writes a former IO's offset address before
> raw_co_prw() completes. As a result, the former zone append IO returns the
> initial value (= the start address of the writing zone), instead of the
> proper address.
>
> Fix the issue by passing the offset pointer to raw_co_prw() instead of
> passing it through s->offset. Also, remove "offset" from BDRVRawState as
> there is no usage anymore.
>
> Fixes: 4751d09adcc3 ("block: introduce zone append write for zoned devices")
> Signed-off-by: Naohiro Aota <naohiro.aota@wdc.com>
> ---
> block/file-posix.c | 16 +++++++---------
> 1 file changed, 7 insertions(+), 9 deletions(-)
Thanks, applied to my block branch:
https://gitlab.com/hreitz/qemu/-/commits/block
Hanna
next prev parent reply other threads:[~2023-11-06 15:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-30 7:38 [PATCH] file-posix: fix over-writing of returning zone_append offset Naohiro Aota
2023-10-30 7:50 ` Sam Li
2023-11-02 3:07 ` Stefan Hajnoczi
2023-11-06 15:16 ` Hanna Czenczek [this message]
2023-11-07 16:29 ` Michael Tokarev
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=499f3f71-5c3e-4a82-a89c-f6d32aaa837b@redhat.com \
--to=hreitz@redhat.com \
--cc=Damien.LeMoal@wdc.com \
--cc=faithilikerun@gmail.com \
--cc=kwolf@redhat.com \
--cc=nao.aota@gmail.com \
--cc=naohiro.aota@wdc.com \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
/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).