Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp34919pxh; Thu, 7 Apr 2022 13:10:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5MhU78Ju/Fc3aLdrtduK+6i/miedsiuvSGq3TFIdiLwY4U14rwJJKnJI/0JFH8pkW9XrI X-Received: by 2002:a17:902:e841:b0:157:1989:cc2c with SMTP id t1-20020a170902e84100b001571989cc2cmr2282819plg.30.1649362219103; Thu, 07 Apr 2022 13:10:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649362219; cv=none; d=google.com; s=arc-20160816; b=GKvpzg1KXkt+0+rZxxysxvp0AtDbyPTC0aXkfXf4a4j5zcPlQYXSdWguZ8W7DqWxB/ LljMf8vuDrtcIdObr30hRNgTuG6kZ6cDHrImrsIpuTdtLao47fTQOGUSx++k5jIeoJeZ 3nzfj81MV4d7wOd7sKeTiz7vnSS4cgLsxulKFH9aRA97UG6R+Zx1xI2CuwGP3EkfBIUA nRJ0T2iXPKPSGw2gf4Be1Y1rwkAGxYzvsv5wFk3Bx29SbuAgGiTvEKioJM9AIFRCbUol 31Z8UwtuimnSY0AP+OovQDYDeZXgNpRXLkLn6gVEFhkAJBhICkTe8fihzKpkcVjLTOh9 2CYQ== 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:to:from :dkim-signature; bh=+7lF47GS27ixFMLChPdYLDH2ipYS5ufxB0854aZrZSs=; b=QOKYPAlQrXYm17U3S152p4aprEHr/9Q0cjSbY5sCoz4/7rk0Ry0HnBjruju7UzV6ZZ 57RBIlWYPZunuBJJO/IPRL+s/rX3T6amI3JAYWkTZN8xfgdC+mEMUvkCgl65n7e7lUxo MBDXOAtK0SPbfuy7YuQjD7peIwi4XY1tDwtkO+P3PG5bogU9m+KTbqXpn8Mrj1+E5Fxu hVtwmHJ9FE5sEv1ppTve4HHtDJ5NiOw2y/6qpvm2DbGwTboFXRelu26X39w5NdNMXn+t HLjFWJPVoAnL9PXURC83yu6FNglC53iYdlz3b2KlFL/scyVLLvXr28vpH/dKbrVKAgPj /7dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IusFPMdp; spf=softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id a38-20020a056a001d2600b004fe50440a05si5954374pfx.331.2022.04.07.13.10.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:10:19 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=IusFPMdp; spf=softfail (google.com: domain of transitioning linux-nfs-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 508062BFC17; Thu, 7 Apr 2022 12:33:01 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347007AbiDGSyc (ORCPT + 99 others); Thu, 7 Apr 2022 14:54:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59868 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347010AbiDGSya (ORCPT ); Thu, 7 Apr 2022 14:54:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0975F194FD8 for ; Thu, 7 Apr 2022 11:52:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id B975FB8260C for ; Thu, 7 Apr 2022 18:52:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CD49C385AA for ; Thu, 7 Apr 2022 18:52:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649357546; bh=67FHcUEJDcE6LZMJdrQMRSXw8wfeTRKDUHlK2IpEf2M=; h=From:To:Subject:Date:In-Reply-To:References:From; b=IusFPMdpAO84X90SCqwixdwBRFZrikfL21+WvJWNGXGoSIP+FTaos9aKG3GjpS3Ps Zvn1jHRTmevBPq2SXqLonSIF2u1tjtFxtLRITqH+Nr/DXM2PV3Vu8w0fBB44UIzVd6 cgxqEWbF0+FfUeOLyKJLFnhkOo1KnCyStreUc5Fo3NxUobFoACy1zCYAuhfIVAMpy0 re9YI0fCwCT3Wbfjx5B5L+L5LntsUP+Zj9IUOdgvozKWaUu+jL+qzPw8SMLI/nLFFS Qec9NbKFfXp048nYKKweJLZs01wVZL27RceRUQ9LyWY7+IDHTtvTJUp2DhRuIkfkL4 fbgXdd2qYBfvg== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH v2 4/8] NFSv4/pnfs: Handle RPC allocation errors in nfs4_proc_layoutget Date: Thu, 7 Apr 2022 14:45:57 -0400 Message-Id: <20220407184601.1064640-4-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220407184601.1064640-3-trondmy@kernel.org> References: <20220407184601.1064640-1-trondmy@kernel.org> <20220407184601.1064640-2-trondmy@kernel.org> <20220407184601.1064640-3-trondmy@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: Trond Myklebust If rpc_run_task() fails due to an allocation error, then bail out early. Fixes: 910ad38697d9 ("NFS: Fix memory allocation in rpc_alloc_task()") Signed-off-by: Trond Myklebust --- fs/nfs/nfs4proc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index e3f5b380cefe..16106f805ffa 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -9615,6 +9615,8 @@ nfs4_proc_layoutget(struct nfs4_layoutget *lgp, long *timeout) nfs4_init_sequence(&lgp->args.seq_args, &lgp->res.seq_res, 0, 0); task = rpc_run_task(&task_setup_data); + if (IS_ERR(task)) + return ERR_CAST(task); status = rpc_wait_for_completion_task(task); if (status != 0) -- 2.35.1