Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp2717913imi; Mon, 25 Jul 2022 06:34:32 -0700 (PDT) X-Google-Smtp-Source: AGRyM1veaYYPMkhqf8w6qSsOFTzL3AOQk7i0GarF6dOwVxfoyZ3Mj7cPzMeb2KE8hYE1yCralVO7 X-Received: by 2002:a05:6a00:1c54:b0:52b:a70e:8207 with SMTP id s20-20020a056a001c5400b0052ba70e8207mr12853947pfw.48.1658756072039; Mon, 25 Jul 2022 06:34:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658756072; cv=none; d=google.com; s=arc-20160816; b=lN6lWwTOBICwyWg9UdPxQpcU6liZdgWXiCSpebASRcjC0g24L0VzYn7PMHy/9do15V sIswQNaHGTCZj5OGcChotINVYJy4W+1g8wQ+/X9zznCoJjDuW2QwaI7UnccMbIyEnGSC Ez9OdEG+CXGQ0XfBVzFV7YjBguiCJL0vX1vIsctfbpLHtnicXzkQgWBvjTNEALEpUXRb ckCp0wKm7IX+remKsiu5wF5MfYemHmsislk9TM9VhB4Fjk3KVDu5MAlzlSonyGnwmPSG 7hUD4Q1JIpVS5m0euV1WUiYWxxxeAjvThq+APy8n2jDNwpo0t2SYNI2pL6Nu2pszcN2p vMow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y70jAlZuFllBcs0jQL6+urZP8GkrpekIVhztVZKEesg=; b=iXz20UOD45xM4+hCDzBc4yNz6RWYzdJ5+B7mwuxALqXnPB/4bDbNc5CGxYTqlXzJHz Ja+pQGoxia6WOlw08sideANV1ltOA05WPhU1e+e70OYShCNXOrXavFwG7iUjDpfFTzrE KPv4ZBm9pslBQEZxvJYJUbubRvo38qFFHvSFgPsM+YbHTRhe00sTD11eZYR+Kjng7y4l CcesNd+evKMa99fdA5BjHNS2/SklbbOI19fUNZd9bVYFrD/PV6/wIyE+voz064AzOxeH mKDZIyuJXvb3Lsq6E0cu7v2iOMXeU6MhO8Fxe0KrVzWLDV9spwaszzNFqhw54DmBx33/ KJOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hQikaHH9; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l24-20020a63ea58000000b00415e89e482asi13511108pgk.177.2022.07.25.06.34.16; Mon, 25 Jul 2022 06:34:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=hQikaHH9; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235492AbiGYNcr (ORCPT + 99 others); Mon, 25 Jul 2022 09:32:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235468AbiGYNcp (ORCPT ); Mon, 25 Jul 2022 09:32:45 -0400 Received: from mail-vk1-xa2c.google.com (mail-vk1-xa2c.google.com [IPv6:2607:f8b0:4864:20::a2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AA1A5DF74 for ; Mon, 25 Jul 2022 06:32:41 -0700 (PDT) Received: by mail-vk1-xa2c.google.com with SMTP id a7so3733650vkl.0 for ; Mon, 25 Jul 2022 06:32:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Y70jAlZuFllBcs0jQL6+urZP8GkrpekIVhztVZKEesg=; b=hQikaHH9gWj/3YMtoGB0sfl+MrlyL7Vbh/PuQoORrcsKO6tVQps0DWW7u0hP4Ayht4 ZZRsGPCiaGTY1vrCpTpfqr8Tb3h1sUgeYNhj6aTKe40PisAxqD3jgLT/k5s5+7KslXzD n8A3UmfL3pvsQU70vaeikZuxDWYPXmt1HgBKSr9xczzlP5OCxO4/tNT2sjMS2Lwl7JfM AqZnsN4F/wmkrPgKqysEqpkwyFiOWp3lHSILQuhbdUKBThrxY3kRqaMs4kucgTdeiSGI kjuqyqZtWbmevXqy4Ep3RRz+UR9yL4Q3fDlnm1vYQzjLvS52GtzNn7UadunoRfkVUVId 1RQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Y70jAlZuFllBcs0jQL6+urZP8GkrpekIVhztVZKEesg=; b=aAIQn+Y+Dt50KW90itt1myRDL4i0mMmgqheDhfsg/W44LXMliuByXa92O+uyQRZIbD bbmugQJZI+ke4nT9Ph/UJu8QGNch7Hw5mz2mD4Zq0zHUTWKh67bXfSaUeNirJfIzX2eW baGDCF/QWI7ObnlVXVjRCDQECjbDz+MNQqRhbTPMP21NZwytG+47n1Eexicoa0GnWyGz 8XSaN5oOOZf/SKavaN/0Yo0fCbsoDCyFMrkCudixU78V82dfFIPaKUBU4TBUOCtFs8C6 DC4wPje8/bjtYIphhFT3dM+KOcUu8gCOpCBpaFy3FxfYo1qB90t+ASAE6UY6Ly8kf0dw twag== X-Gm-Message-State: AJIora++D6dwkqalW5RvCGb3pFoP2fbnELw4+7m2Yg+dSeP5N478C33L ZZb1OExtLrvEk76jPyreAVA= X-Received: by 2002:a1f:48c7:0:b0:376:3a67:4c13 with SMTP id v190-20020a1f48c7000000b003763a674c13mr2386003vka.2.1658755959954; Mon, 25 Jul 2022 06:32:39 -0700 (PDT) Received: from localhost.localdomain (071-047-011-047.res.spectrum.com. [71.47.11.47]) by smtp.gmail.com with ESMTPSA id a6-20020ab06306000000b00383aeb53100sm2128826uap.16.2022.07.25.06.32.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Jul 2022 06:32:39 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v3 05/11] SUNRPC enable back offline transports in trunking discovery Date: Mon, 25 Jul 2022 09:32:25 -0400 Message-Id: <20220725133231.4279-6-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.30.1 (Apple Git-130) In-Reply-To: <20220725133231.4279-1-olga.kornievskaia@gmail.com> References: <20220725133231.4279-1-olga.kornievskaia@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Olga Kornievskaia When we are adding a transport to a xprt_switch that's already on the list but has been marked OFFLINE, then make the state ONLINE since it's been tested now. Signed-off-by: Olga Kornievskaia --- include/linux/sunrpc/clnt.h | 1 + net/sunrpc/clnt.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index d14333f4947a..71a3a1dd7e81 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h @@ -242,6 +242,7 @@ void rpc_clnt_xprt_switch_put(struct rpc_clnt *); void rpc_clnt_xprt_switch_add_xprt(struct rpc_clnt *, struct rpc_xprt *); bool rpc_clnt_xprt_switch_has_addr(struct rpc_clnt *clnt, const struct sockaddr *sap); +void rpc_clnt_xprt_set_online(struct rpc_clnt *clnt, struct rpc_xprt *xprt); void rpc_cleanup_clids(void); static inline int rpc_reply_expected(struct rpc_task *task) diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 68021b70340d..9dbce3b0d3a2 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c @@ -3095,8 +3095,22 @@ void rpc_clnt_xprt_switch_put(struct rpc_clnt *clnt) } EXPORT_SYMBOL_GPL(rpc_clnt_xprt_switch_put); +void rpc_clnt_xprt_set_online(struct rpc_clnt *clnt, struct rpc_xprt *xprt) +{ + struct rpc_xprt_switch *xps; + + rcu_read_lock(); + xps = rcu_dereference(clnt->cl_xpi.xpi_xpswitch); + rcu_read_unlock(); + xprt_set_online_locked(xprt, xps); +} + void rpc_clnt_xprt_switch_add_xprt(struct rpc_clnt *clnt, struct rpc_xprt *xprt) { + if (rpc_clnt_xprt_switch_has_addr(clnt, + (const struct sockaddr *)&xprt->addr)) { + return rpc_clnt_xprt_set_online(clnt, xprt); + } rcu_read_lock(); rpc_xprt_switch_add_xprt(rcu_dereference(clnt->cl_xpi.xpi_xpswitch), xprt); -- 2.27.0