nvme-fabrics: centralize discovery controller defaults
authorHannes Reinecke <hare@suse.de>
Thu, 24 May 2018 14:18:15 +0000 (16:18 +0200)
committerChristoph Hellwig <hch@lst.de>
Fri, 25 May 2018 14:50:12 +0000 (16:50 +0200)
When connecting to the discovery controller we have certain defaults
to observe, so centralize them to avoid inconsistencies due to argument
ordering.

Signed-off-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: James Smart <james.smart@broadcom.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/fabrics.c

index 6fdf499d16b4e0ae9fd2f1608b5d3895cf726bea..5ad6104577f0245a40679afda9b44a50edb1d9a7 100644 (file)
@@ -689,10 +689,6 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
                        opts->discovery_nqn =
                                !(strcmp(opts->subsysnqn,
                                         NVME_DISC_SUBSYS_NAME));
-                       if (opts->discovery_nqn) {
-                               opts->kato = 0;
-                               opts->nr_io_queues = 0;
-                       }
                        break;
                case NVMF_OPT_TRADDR:
                        p = match_strdup(args);
@@ -851,6 +847,10 @@ static int nvmf_parse_options(struct nvmf_ctrl_options *opts,
                }
        }
 
+       if (opts->discovery_nqn) {
+               opts->kato = 0;
+               opts->nr_io_queues = 0;
+       }
        if (ctrl_loss_tmo < 0)
                opts->max_reconnects = -1;
        else