From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Dmitry Fomichev <dmitry.fomichev@wdc.com>,
Klaus Jensen <k.jensen@samsung.com>,
Keith Busch <kbusch@kernel.org>, Kevin Wolf <kwolf@redhat.com>,
Max Reitz <mreitz@redhat.com>,
qemu-devel@nongnu.org
Cc: Niklas Cassel <niklas.cassel@wdc.com>
Subject: Re: [PATCH] hw/block/nvme: fix Close Zone
Date: Mon, 8 Feb 2021 10:03:15 +0100 [thread overview]
Message-ID: <435eb631-e53d-a47a-6c27-68d12496fe00@redhat.com> (raw)
In-Reply-To: <20210208003256.9280-1-dmitry.fomichev@wdc.com>
Hi Dmitry, Klaus.
On 2/8/21 1:32 AM, Dmitry Fomichev wrote:
> Implicitly and Explicitly Open zones can be closed by Close Zone
> management function. This got broken by a recent commit and now such
> commands fail with Invalid Zone State Transition status.
>
> Modify nvm_zrm_close() function to make Close Zone work correctly.
>
> Signed-off-by: Dmitry Fomichev <dmitry.fomichev@wdc.com>
> Fixes: 053b5a302c3("hw/block/nvme: refactor zone resource management")
'053b5a302c3': unknown revision or path not in the working tree.
If you point at an unmerged commit, why not fix it directly
before merging?
> ---
> hw/block/nvme.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/hw/block/nvme.c b/hw/block/nvme.c
> index 6b84e34843..c2f0c88fbf 100644
> --- a/hw/block/nvme.c
> +++ b/hw/block/nvme.c
> @@ -1308,14 +1308,13 @@ static uint16_t nvme_zrm_finish(NvmeNamespace *ns, NvmeZone *zone)
> static uint16_t nvme_zrm_close(NvmeNamespace *ns, NvmeZone *zone)
> {
> switch (nvme_get_zone_state(zone)) {
> - case NVME_ZONE_STATE_CLOSED:
> - return NVME_SUCCESS;
> -
> case NVME_ZONE_STATE_EXPLICITLY_OPEN:
> case NVME_ZONE_STATE_IMPLICITLY_OPEN:
> nvme_aor_dec_open(ns);
> nvme_assign_zone_state(ns, zone, NVME_ZONE_STATE_CLOSED);
> /* fall through */
> + case NVME_ZONE_STATE_CLOSED:
> + return NVME_SUCCESS;
>
> default:
> return NVME_ZONE_INVAL_TRANSITION;
>
next prev parent reply other threads:[~2021-02-08 14:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20210208003303eucas1p1cb3eb9d86fa82db23f6290ce3e24ef96@eucas1p1.samsung.com>
2021-02-08 0:32 ` [PATCH] hw/block/nvme: fix Close Zone Dmitry Fomichev
2021-02-08 6:24 ` Klaus Jensen
2021-02-08 9:03 ` Philippe Mathieu-Daudé [this message]
2021-02-08 9:14 ` Klaus Jensen
2021-02-08 9:20 ` Klaus Jensen
2021-02-08 15:54 ` Keith Busch
2021-02-08 16:19 ` Philippe Mathieu-Daudé
2021-02-08 17:53 ` Klaus Jensen
2021-02-09 17:31 ` Dmitry Fomichev
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=435eb631-e53d-a47a-6c27-68d12496fe00@redhat.com \
--to=philmd@redhat.com \
--cc=dmitry.fomichev@wdc.com \
--cc=k.jensen@samsung.com \
--cc=kbusch@kernel.org \
--cc=kwolf@redhat.com \
--cc=mreitz@redhat.com \
--cc=niklas.cassel@wdc.com \
--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).