From patchwork Mon Apr 26 17:19:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olga Kornievskaia X-Patchwork-Id: 12224693 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 298B1C433B4 for ; Mon, 26 Apr 2021 17:20:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EE2E2610A2 for ; Mon, 26 Apr 2021 17:20:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237027AbhDZRUq (ORCPT ); Mon, 26 Apr 2021 13:20:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236841AbhDZRUj (ORCPT ); Mon, 26 Apr 2021 13:20:39 -0400 Received: from mail-io1-xd2d.google.com (mail-io1-xd2d.google.com [IPv6:2607:f8b0:4864:20::d2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54895C06138E for ; Mon, 26 Apr 2021 10:19:55 -0700 (PDT) Received: by mail-io1-xd2d.google.com with SMTP id v123so5703179ioe.10 for ; Mon, 26 Apr 2021 10:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yV4RoRoB2tILS34+fpesh6cjG3ew0tRbFeD0KUnY3Ss=; b=efleueftMbvfq6GbbGowcTszLdcy9tL57Gsfv8uMljO2H7KHjjomUyi/dsKlfRahas RvGL6vfyE6QlM3Z1TE/lthIN6E5+00GIcuWx/UKxZ9pC23ruoOa1rD0tjFTxi+oT7bNm 07d5EaBXRODLGtKDHnAv2vKDSOKBVCGwlEC0k0iuWRlgi7D4tSYSXdiq8D1/TlSfVUi4 g5IXawvPM93arR2v57sQ2x90kiSDvpgK/Y3/r1NeQtQ32lSHrJD/ytwTKWkqS/OO5m3Q R1ziAPb26/iMPLNiZYKnaB8ml01z6M6TM19X4BTOJx1uC8XeUMwSQCOut8a4FoKmMDC1 UmMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=yV4RoRoB2tILS34+fpesh6cjG3ew0tRbFeD0KUnY3Ss=; b=jGyZws0g1v7Z7V+POJmJzU7JVuDmdDgrHTD6vyB8JHiHlxqt+yGiWi79yhbEKXZqI0 coPXDOhNUJKpzabqHGgAVWMRqe9q90KgX3/XpT0+NJi0i+AOAMxmp6nNGXfS6w1rFF4C enQ+c7GL/nx0gvBysODMkyGHJHdOlQ4TsMJOrtGEioOpanyP9/NnHdupg0dP7EJhpgxY 2jLx36Eolib3DnieBaHx479Qh3mAp0s+7tYoXyDVqLXzpNlx1qQy6ANckF2N11RuTIzz NVqfQX+k4JMsdElr0DaefOlrk+sRXlUBVtVMemS1bkrpRU8SvdmJmI3JxVtMk/j4Agy1 hssA== X-Gm-Message-State: AOAM530B+nPMCWzC4Iqfe3gi1QltNQ7p9797W80TytlBnLtEDbzJGoXl Ic8oh7peT+yYOQ9N19O5Mlc= X-Google-Smtp-Source: ABdhPJyGSEa2BSX7IWk4ICuLQWSX1EouL1b4Y/qLx+xwOVuwNlNagbbwussFgaa7eLQ8KB4SkdvVNw== X-Received: by 2002:a05:6602:1da:: with SMTP id w26mr15446047iot.170.1619457594779; Mon, 26 Apr 2021 10:19:54 -0700 (PDT) Received: from kolga-mac-1.attlocal.net (172-10-226-31.lightspeed.livnmi.sbcglobal.net. [172.10.226.31]) by smtp.gmail.com with ESMTPSA id x13sm207297ilq.85.2021.04.26.10.19.53 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Apr 2021 10:19:54 -0700 (PDT) From: Olga Kornievskaia To: trond.myklebust@hammerspace.com, anna.schumaker@netapp.com Cc: linux-nfs@vger.kernel.org Subject: [PATCH v3 04/13] sunrpc: Prepare xs_connect() for taking NULL tasks Date: Mon, 26 Apr 2021 13:19:38 -0400 Message-Id: <20210426171947.99233-5-olga.kornievskaia@gmail.com> X-Mailer: git-send-email 2.24.3 (Apple Git-128) In-Reply-To: <20210426171947.99233-1-olga.kornievskaia@gmail.com> References: <20210426171947.99233-1-olga.kornievskaia@gmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org From: Anna Schumaker We won't have a task structure when we go to change IP addresses, so check for one before calling the WARN_ON() to avoid crashing. Signed-off-by: Anna Schumaker Signed-off-by: Olga Kornievskaia --- net/sunrpc/xprtsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 47aa47a2b07c..2bcb80c19339 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c @@ -2317,7 +2317,7 @@ static void xs_connect(struct rpc_xprt *xprt, struct rpc_task *task) struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); unsigned long delay = 0; - WARN_ON_ONCE(!xprt_lock_connect(xprt, task, transport)); + WARN_ON_ONCE(task && !xprt_lock_connect(xprt, task, transport)); if (transport->sock != NULL) { dprintk("RPC: xs_connect delayed xprt %p for %lu "