Received: by 2002:a05:6a10:83d0:0:0:0:0 with SMTP id o16csp35760pxh; Thu, 7 Apr 2022 13:11:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywf4avn3O6PpS/1uytHd8nL/thMTFgRvPgBPWuJAywGen702b/8vGtMAjK1LT8++7cn+Sd X-Received: by 2002:a05:6a00:244a:b0:4fa:ebf9:75de with SMTP id d10-20020a056a00244a00b004faebf975demr15743279pfj.73.1649362312850; Thu, 07 Apr 2022 13:11:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649362312; cv=none; d=google.com; s=arc-20160816; b=r0OE3wCZ8KBnNd6c+pF/bwZRsGB4qjXD8ANmGLlBy38x5/9ap+CKHz0gE4l08j5Cuj Ur3rFI+IZRjxlphVtCxi7uEfwTR6p3+6qv8obHYqxwaqgY6o3pROPsynQxNWp0u06i4D i10kWtLVAXWlDluh4ExiIuAu5Tx2cO98hsYc1WtTTYdeNjh8TLuqM/fpBmX1ie/1ae8Y bwgG6NwUHoWoXctfld3B1E1G8GGBEUCdnzbqaRBhCfzFqvEwzvtJJ59lPB+AsWGaigD7 Ge6Al0n08bvkMpbprz1HBOaWyyEkbTyhQMAEvHQWxP7+YcIlmhi9nhWtfX/M8hm+rqq7 GOoA== 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=54i/tvs7WgSAaACtUVsK6YxjZowWDSstQEjxCbU/69o=; b=j4cU4+bZvyOPr+VeCp24admoOH5yEuSlzgGUWajy4P09wDZtQXfISmxV2W9oT94yTH I0qQiuLWySNH8RV3dYtCsxXnGWN0R0MmI6Oj1pJbgGGXFtHVbHtgE76Z7XBagA5Rk5WK hrXWv1CV0WmefVQFcylFaLfK1CRHTJ77lSIv0TJBblYnRByyVpVLHytCJ0zeqmQebsfS VHYzU1PfpYYHeL62o4LH9gaiz5LW+6JT+bYFPCEfssP8K8rqrGq1w0LxWCu7xVjOTARb 5E72j1xXULD4cERa6XM9ZJecaII61rqEcCnIEjhfHxDqaMHFrm47xzYrL7aD/pPTmKJK 1BLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jvZG9czS; 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 s4-20020a170903200400b00156aa846117si453433pla.622.2022.04.07.13.11.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Apr 2022 13:11:52 -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=jvZG9czS; 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 147412CB3B8; Thu, 7 Apr 2022 12:33:55 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345025AbiDGPrV (ORCPT + 99 others); Thu, 7 Apr 2022 11:47:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345104AbiDGPqr (ORCPT ); Thu, 7 Apr 2022 11:46:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C92EC6B7A for ; Thu, 7 Apr 2022 08:44:34 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 6927061EC5 for ; Thu, 7 Apr 2022 15:44:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82AFAC385A4 for ; Thu, 7 Apr 2022 15:44:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1649346272; bh=pj6f8DlWv3kPYUyaziTO0UM8iZIeqmqtlEJMypSzRhQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=jvZG9czSd403JHlkKDkOZZaTdfMUJ06XR3QXX3FbR6HHlzV6fwLJI3gidpwL81TyH iqchSy+3pdTxhIsLFgW9tB1NDaNKnLHk9QeydtrW1F2U2TNJOiAayfCQwHFOQHRwuQ DgeXmgO1qfTKJPIS0N0UjCX11ufW4ulLZ377m7/Phjdny+wQS7mwo5PSL0Ili/Gzqe APARN66cODfiD8Bx5ldbFGqN8cCe7bJDbLMKiJpEaVDwOtMf7Njg8VNoJorE9c1uBp MG0AwcJeYzDYmEWQzIsxhZOkbOJiyDlDJxbeXiMXEmz64uoJ+06BcEcx4AhdxhX07j NoeRv06KnQGqw== From: trondmy@kernel.org To: linux-nfs@vger.kernel.org Subject: [PATCH 4/7] NFSv4/pnfs: Handle RPC allocation errors in nfs4_proc_layoutget Date: Thu, 7 Apr 2022 11:38:06 -0400 Message-Id: <20220407153809.1053261-4-trondmy@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220407153809.1053261-3-trondmy@kernel.org> References: <20220407153809.1053261-1-trondmy@kernel.org> <20220407153809.1053261-2-trondmy@kernel.org> <20220407153809.1053261-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. 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