[PATCH v5] nvme-fabrics: reject I/O to offline device
Ewan D. Milne
emilne at redhat.com
Wed Jul 1 17:12:39 EDT 2020
I'm seeing an I/O hang followed by errors returned to userspace on
NVMe/FC and NVMe multipath with the v4 patch. It fails right away.
This is with a test that does alternating link bouncing on the target.
-Ewan
On Tue, 2020-06-30 at 17:18 -0700, Sagi Grimberg wrote:
> > @@ -612,6 +613,8 @@ bool __nvmf_check_ready(struct nvme_ctrl *ctrl,
> > struct request *rq,
> > { NVMF_OPT_NR_WRITE_QUEUES, "nr_write_queues=%d" },
> > { NVMF_OPT_NR_POLL_QUEUES, "nr_poll_queues=%d" },
> > { NVMF_OPT_TOS, "tos=%d" },
> > + { NVMF_OPT_FAIL_FAST_TMO, "fast_io_fail_tmo=%d" },
> > + { NVMF_OPT_FAIL_FAST_TMO, "fast_io_fail_tmo=%s" },
> > { NVMF_OPT_ERR, NULL }
> > };
> >
> > @@ -631,6 +634,7 @@ static int nvmf_parse_options(struct
> > nvmf_ctrl_options *opts,
> > opts->reconnect_delay = NVMF_DEF_RECONNECT_DELAY;
> > opts->kato = NVME_DEFAULT_KATO;
> > opts->duplicate_connect = false;
> > + opts->fast_io_fail_tmo = NVMF_DEF_FAIL_FAST_TMO;
> > opts->hdr_digest = false;
> > opts->data_digest = false;
> > opts->tos = -1; /* < 0 == use transport default */
> > @@ -751,6 +755,28 @@ static int nvmf_parse_options(struct
> > nvmf_ctrl_options *opts,
> > pr_warn("ctrl_loss_tmo < 0 will
> > reconnect forever\n");
> > ctrl_loss_tmo = token;
> > break;
> > + case NVMF_OPT_FAIL_FAST_TMO:
> > + if (match_int(args, &token)) {
> > + p = match_strdup(args);
> > + if (!p) {
> > + ret = -EINVAL;
> > + goto out;
> > + }
> > +
> > + token = strcasecmp(p, "off") ? 0 : -1;
> > + kfree(p);
> > +
> > + if (!token) {
> > + ret = -EINVAL;
> > + goto out;
> > + }
>
> Rethinking about this when reading the code, let's drop the "off"
> string
> option, nvme-cli is probably the better place for free text
> processing...
>
> I think that overall this looks reasonable. But I'd like to hear
> others
> on this. Keith, Christoph, Chaitanya, James, Hannes, please review
> this approach.
>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
>
More information about the Linux-nvme
mailing list