]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
fabrics: fix infinite loop on invalid parameters
authorHannes Reinecke <hare@suse.de>
Wed, 24 Mar 2021 06:39:31 +0000 (07:39 +0100)
committerKeith Busch <kbusch@kernel.org>
Wed, 24 Mar 2021 16:04:04 +0000 (10:04 -0600)
When parsing the discovery entries results in invalid parameters
for a given connection we'll enter an infinite loop as the -EINVAL
error code is always assumed to indicate a wrong 'disable_sqflow'
setting.

Signed-off-by: Hannes Reinecke <hare@suse.de>
fabrics.c

index ff34c3039faff975d2ef2572050d694349dd00e7..227773d1055de6d27af39429414435bfa3467c66 100644 (file)
--- a/fabrics.c
+++ b/fabrics.c
@@ -1241,7 +1241,8 @@ retry:
                ret = do_discover(argstr, true, flags);
        } else
                ret = add_ctrl(argstr);
-       if (ret == -EINVAL && e->treq & NVMF_TREQ_DISABLE_SQFLOW) {
+       if (ret == -EINVAL && disable_sqflow &&
+           e->treq & NVMF_TREQ_DISABLE_SQFLOW) {
                /* disable_sqflow param might not be supported, try without it */
                disable_sqflow = false;
                goto retry;