SUNRPC: fix _xprt_switch_find_current_entry logic
authorOlga Kornievskaia <kolga@netapp.com>
Fri, 1 Dec 2023 19:42:03 +0000 (14:42 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 4 Jan 2024 15:47:56 +0000 (10:47 -0500)
Fix the logic for picking current transport entry.

Fixes: 95d0d30c66b8 ("SUNRPC create an iterator to list only OFFLINE xprts")
Signed-off-by: Olga Kornievskaia <kolga@netapp.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
net/sunrpc/xprtmultipath.c

index 0706575d93922f64481b5fdffb199e178afcb18d..720d3ba742ec02acd6cc1d2a9bc97d911f466e50 100644 (file)
@@ -284,7 +284,7 @@ struct rpc_xprt *_xprt_switch_find_current_entry(struct list_head *head,
                if (cur == pos)
                        found = true;
                if (found && ((find_active && xprt_is_active(pos)) ||
-                             (!find_active && xprt_is_active(pos))))
+                             (!find_active && !xprt_is_active(pos))))
                        return pos;
        }
        return NULL;