Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3162053rdh; Mon, 27 Nov 2023 07:42:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IHC/2fWQbHNYNcbV+wdmZ3sBaxd0JAxtnfrh3oB3u/Z9+LACi0JJrkSBKTUcbNy+DT/wau/ X-Received: by 2002:a05:6a20:1445:b0:18c:5c04:5564 with SMTP id a5-20020a056a20144500b0018c5c045564mr6205273pzi.60.1701099768739; Mon, 27 Nov 2023 07:42:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701099768; cv=none; d=google.com; s=arc-20160816; b=oP6tW1hoWd9WPn4klRPhhhcpa1tK57N/0WwHqGHg46o5DCjEjhTNK1l/lCpcPNdKmP y7bVK7uu730Ak++/IhaEkjBWMCKOAP132C9FIPiDCmJIMtkf/qP+1YDYqvslHcmwgfHB QbOYlXFc1Gye8bHQBAEC3R9yCema4CcEfog58lWlb3HB22cCmJ3SWefB55MB9QUFOCqF Erc6CKQPS32esbqojnnbRe2VdkCDWMek9S5z3kRYAfR5qN0858r6RuEgp61sjXp8bOv+ xj7w4J54P5EEVE3dWLvLBtrgFVGMe9ayvfLsQMiacj8BaBiSGWxtuPcaDBERINzAUr06 CPug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=dyfvfNPN1qDnXBoUG9NhY9AG6Sdim3jKU6PwiaMU4QM=; fh=sJu0CwZ/iPkKM6j6FJmjTdVETYRyqioM7RK27qbLPKk=; b=El4R+qj5HIhGbGWWLt0ZSKx3AdBzOIG+5QhVJ0pNdIICDu3NJBuMHMwJLSAf3IoBMY gZYu7TCqONmpRIV+OM8C+sS7u1ZYtJIIBYSkzq/QU9zbPXvJ0LoqhZXzpYPMkFSoPNbA Px0tblAuwxWjmsm/us139Vigntfou13EQ56UGIr9jF2kO6vK1LXLCvtyycofejP/Cqjt 9EIFjKw6mV/kRJMEfieSwNymwC7P3aUO+zlnMB7dsO1fylAKNKqGobeyQOTU0GTMxso8 3gBi7MfL/rTsBtRAzZxmmwN4KslwlHbtgdv3GRPoB3lX4nj9BjkgVaRvEOFTQ6ZvRIlx h2Pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-nfs+bounces-91-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-91-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id r4-20020aa78b84000000b006cda003351fsi18695pfd.126.2023.11.27.07.42.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 07:42:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs+bounces-91-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-nfs+bounces-91-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-nfs+bounces-91-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 11409281568 for ; Mon, 27 Nov 2023 15:42:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 17E3634551; Mon, 27 Nov 2023 15:42:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=none X-Original-To: linux-nfs@vger.kernel.org X-Greylist: delayed 145 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Mon, 27 Nov 2023 07:42:41 PST Received: from r3-25.sinamail.sina.com.cn (r3-25.sinamail.sina.com.cn [202.108.3.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FE2992 for ; Mon, 27 Nov 2023 07:42:41 -0800 (PST) X-SMAIL-HELO: localhost.localdomain Received: from unknown (HELO localhost.localdomain)([120.245.112.246]) by sina.cn (172.16.97.23) with ESMTP id 6564B85B000094F0; Mon, 27 Nov 2023 23:40:13 +0800 (CST) X-Sender: thfeathers@sina.cn X-Auth-ID: thfeathers@sina.cn Authentication-Results: sina.cn; spf=none smtp.mailfrom=thfeathers@sina.cn; dkim=none header.i=none; dmarc=none action=none header.from=thfeathers@sina.cn X-SMAIL-MID: 11568731457678 X-SMAIL-UIID: 3FA53262185F4214A4EBD3FD776C25B1-20231127-234013-1 From: jsq To: chuck.lever@oracle.com, jlayton@kernel.org Cc: neilb@suse.de, kolga@netapp.com, Dai.Ngo@oracle.com, tom@talpey.com, linux-nfs@vger.kernel.org, jsq Subject: [PATCH] SUNRPC: _xprt_switch_find_current_entry return xprt with condition find_active Date: Mon, 27 Nov 2023 23:39:59 +0800 Message-ID: <20231127153959.2067-1-thfeathers@sina.cn> X-Mailer: git-send-email 2.43.0.windows.1 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit current function always return a active xprt or NULL no matter what find_active --- net/sunrpc/xprtmultipath.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/net/sunrpc/xprtmultipath.c b/net/sunrpc/xprtmultipath.c index 701250b305db..94f3b5f444a1 100644 --- a/net/sunrpc/xprtmultipath.c +++ b/net/sunrpc/xprtmultipath.c @@ -283,8 +283,7 @@ struct rpc_xprt *_xprt_switch_find_current_entry(struct list_head *head, list_for_each_entry_rcu(pos, head, xprt_switch) { if (cur == pos) found = true; - if (found && ((find_active && xprt_is_active(pos)) || - (!find_active && xprt_is_active(pos)))) + if (found && (find_active == xprt_is_active(pos))) return pos; } return NULL; -- 2.43.0.windows.1