From: Keith Busch <keith.busch@linux.intel.com>
To: Johannes Thumshirn <jthumshirn@suse.de>
Cc: Keith Busch <keith.busch@intel.com>,
Sagi Grimberg <sagi@grimberg.me>,
James Smart <james.smart@broadcom.com>,
Linux NVMe Mailinglist <linux-nvme@lists.infradead.org>,
Linux Kernel Mailinglist <linux-kernel@vger.kernel.org>,
Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] nvmet: switch loopback target state to connecting when resetting
Date: Thu, 3 May 2018 09:31:42 -0600 [thread overview]
Message-ID: <20180503153142.GN5938@localhost.localdomain> (raw)
In-Reply-To: <20180503150035.13918-1-jthumshirn@suse.de>
On Thu, May 03, 2018 at 05:00:35PM +0200, Johannes Thumshirn wrote:
> After commit bb06ec31452f ("nvme: expand nvmf_check_if_ready checks")
> resetting of the loopback nvme target failed as we forgot to switch
> it's state to NVME_CTRL_CONNECTING before we reconnect the admin
> queues. Therefore the checks in nvmf_check_if_ready() choose to go to
> the reject_io case and thus we couldn't sent out an identify
> controller command to reconnect.
>
> Change the controller state to NVME_CTRL_CONNECTING after tearing down
> the old connection and before re-establishing the connection.
>
> Fixes: bb06ec31452f ("nvme: expand nvmf_check_if_ready checks")
> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
> ---
> drivers/nvme/target/loop.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drivers/nvme/target/loop.c b/drivers/nvme/target/loop.c
> index 31fdfba556a8..27a8561c0cb9 100644
> --- a/drivers/nvme/target/loop.c
> +++ b/drivers/nvme/target/loop.c
> @@ -469,6 +469,12 @@ static void nvme_loop_reset_ctrl_work(struct work_struct *work)
> nvme_stop_ctrl(&ctrl->ctrl);
> nvme_loop_shutdown_ctrl(ctrl);
>
> + if (!nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING)) {
> + /* state change failure should never happen */
> + WARN_ON_ONCE(1);
> + return;
> + }
> +
> ret = nvme_loop_configure_admin_queue(ctrl);
> if (ret)
> goto out_disable;
> --
> 2.16.3
Thanks, applied to the 4.17 nvme branch.
prev parent reply other threads:[~2018-05-03 15:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-03 15:00 [PATCH] nvmet: switch loopback target state to connecting when resetting Johannes Thumshirn
2018-05-03 15:31 ` Keith Busch [this message]
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=20180503153142.GN5938@localhost.localdomain \
--to=keith.busch@linux.intel.com \
--cc=hch@lst.de \
--cc=james.smart@broadcom.com \
--cc=jthumshirn@suse.de \
--cc=keith.busch@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
--cc=sagi@grimberg.me \
/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