All of lore.kernel.org
 help / color / mirror / Atom feed
From: hare@suse.de (Hannes Reinecke)
Subject: [PATCH 4/5] nvme-multipath: disable ANA support if parsing fails
Date: Thu, 19 Jul 2018 18:00:43 +0200	[thread overview]
Message-ID: <fda50728-d90c-2915-0ba3-7f7a3c7cd613@suse.de> (raw)
In-Reply-To: <20180719144355.GA20422@lst.de>

On 07/19/2018 04:43 PM, Christoph Hellwig wrote:
> On Mon, Jul 16, 2018@12:58:36PM +0200, Hannes Reinecke wrote:
>> If we cannot parse the ANA log page we should just disable ANA
>> support altogether, otherwise we fail to connect to the controller
>> and we have no way of figuring out what went wrong.
>> And we should kill the WARN_ON() statements as we now have a valid
>> recovery strategy.
> 
> I don't like this.  There is a lot magic now where we need to
> check if we have a buffer independent of wheter the controller
> supports ANA to start with.
> 
> If we really have a that buggy controller we'll need to quirk it.
> 
Well, I've came across this will testing ANA support on the target.

There are two reasons why I did this:

1. There's this statement in nvme_failover_req():

	if (!WARN_ON_ONCE(!ns->ctrl->ana_log_buf))
		queue_work(nvme_wq, &ns->ctrl->ana_work);

(or a similar statement in nvme_handle_aen_notice())
which really doesn't make sense if we require 'ana_log_buf' to always be 
filled out.
If we require ana_log_buf to always be set we would crash immediately 
afterwards in nvme_read_ana_log() anyway, rendering the WARN_ON quite 
pointless.
So, from my POV, either remove the WARN_ON() (or at least replace it 
with a BUG_ON() to clarify we've messed up) or handle the case where 
ana_log_buf is _NOT_ set. But that involves graceful failure handling 
while parsing ANA log pages.

2. If we come across a target with invalid or incorrect ANA 
implementations we _cannot_ connect at all (as nvme_mpath_init() will 
return an error, causing mpath_init_identify() to fail, too).
Which means we don't have _any_ way of figuring out what went wrong.
So I've opted to handle error gracefully and disabling ANA support for 
those targets (which is perfectly legit methinks), allowing us to 
inspect the log page via nvme-cli and figure out what went wrong.

And in general I thought it was good practice to handle errors gracefully...

Cheers,

Hannes

  reply	other threads:[~2018-07-19 16:00 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-16 10:58 [PATCH 0/5] nvme: ANA implementation fixes Hannes Reinecke
2018-07-16 10:58 ` [PATCH 1/5] nvme: count all ANA groups for ANA Log page Hannes Reinecke
2018-07-19 14:31   ` Christoph Hellwig
2018-09-17 13:49   ` Christoph Hellwig
2018-07-16 10:58 ` [PATCH 2/5] nvmet: fixup crash on NULL device path Hannes Reinecke
2018-07-17 13:48   ` Christoph Hellwig
2018-07-17 13:48     ` Hannes Reinecke
2018-07-17 13:55       ` Christoph Hellwig
2018-07-24 14:02       ` Christoph Hellwig
2018-07-25  7:25         ` Hannes Reinecke
2018-07-16 10:58 ` [PATCH 3/5] nvme-multipath: fixup crash during disconnect Hannes Reinecke
2018-07-19 14:31   ` Christoph Hellwig
2018-07-19 14:35     ` Christoph Hellwig
2018-07-16 10:58 ` [PATCH 4/5] nvme-multipath: disable ANA support if parsing fails Hannes Reinecke
2018-07-19 14:43   ` Christoph Hellwig
2018-07-19 16:00     ` Hannes Reinecke [this message]
2018-07-20 15:00       ` Christoph Hellwig
2018-07-16 10:58 ` [PATCH 5/5] nvme-multipath: parse entire ANA log page in nvme_set_ns_ana_state() Hannes Reinecke
2018-07-19 14:46   ` Christoph Hellwig

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=fda50728-d90c-2915-0ba3-7f7a3c7cd613@suse.de \
    --to=hare@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.