Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp659533imw; Thu, 14 Jul 2022 08:29:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1ugyfa+LPNxKOxRaKs5QfPGYH0r/VE9t/obmxsZGIDADuDc7DgPSABp/DQsJyAhLdIwfIWu X-Received: by 2002:a17:907:761b:b0:72b:379e:39ea with SMTP id jx27-20020a170907761b00b0072b379e39eamr9350590ejc.591.1657812545046; Thu, 14 Jul 2022 08:29:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657812545; cv=none; d=google.com; s=arc-20160816; b=NhPuzLumojWeQmqdY2s16bsuorcDlmNi2xXSkOKxzQ2we1oWMrIyneGDA1HzsPslK+ rASPs7P5o8GErpAl24Pn6a7zPynG/r833pMpmtWm8LwkseYKu5Wa87Jw1uI5FJpNLm57 UhBTF1vpDXtsra6rtNGTe6iKYPoI0KJy3TeqXHQeKcQ7MmB73U/fyRqTC4Ivxbx9HpuY 5E6bHGJFbP6HJxkHLSD1Gz+7o1g+SSKDOJP0aLgcZMKIo5yPIZ01TTBfmvtV0op/r3Z8 xAEq+bgg3AhK7r7PTDl95/3JKu1Wx0etLoa9XFyvRFc4+woZgdsAqyeYWDtcsQ/2oVgb dDww== 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=pWyRoRFPOxsvwuqYe3bquwDcNWHTj+tvM0vN3erznH8=; b=vpDoUG6u9xuSLQ9GJ3OCIrhgoWBT7pgkUlvm3YVxSayac9rT8T525lpt4QrgL8+Ir6 3tWXky+tgpMQnxoMKTLdQBqNs6zCAMExcWeVNWWzrmOmxds/araEcQmDZ9+zxWsdgfRM RKJycfNb789PSwevMQqXWt9jF7YZvxJDpGa5baaceltO7pWHtlZLeDWPpSWkuOmIeQv2 QKB8lh3itxsjpp+G3FfJcavHnkEj+hncPvgX0kdJs1sju1Vf9ZkPWTLb7PN6i+J1J1HJ kSl0oPf9UxqxIh8VDvy9dw96FvyBEksgP6YS8FGgS7ieGOA9xr9ZWTbvWxg0ivqVu1CU Zxtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="MQFpgih/"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d30-20020a056402401e00b0043a69ee06c0si2544854eda.68.2022.07.14.08.28.32; Thu, 14 Jul 2022 08:29:05 -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=@kernel.org header.s=k20201202 header.b="MQFpgih/"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240135AbiGNP2Z (ORCPT + 99 others); Thu, 14 Jul 2022 11:28:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239872AbiGNP2Y (ORCPT ); Thu, 14 Jul 2022 11:28:24 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1F61491D1 for ; Thu, 14 Jul 2022 08:28:23 -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 7C66B61F32 for ; Thu, 14 Jul 2022 15:28:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 80E07C341C8; Thu, 14 Jul 2022 15:28:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657812502; bh=4dH+Z8EaITtBuQui+zpdms7bIDirkY3nsFZuy8eBYPI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MQFpgih/YnaSVdMdHNY1sdqhWQfs3EOYverkFlmX+DEHVXnRG/2hDmL8XfU5IP/Ve rAbyMcaY30VFcBszL0ce2WBpfofUzCsFNFisOtELzxThxHZEZziJkhAlXkAKlbF5NH qM8SxQzylpmCvAywCIajVLWE+HPXuUd2lPN/3sUlr1HdKUM5gVqryE5fWM51XJLALF NbAff0P4MSFBd1feVR2EJClb6tJfSD7Qasie8Htt+ykMocrXvPrq6Ft7946py4C4/S SHSy69LO50Lb0X5DvDSViiGXPR+Q9oHMrOCVflbL/5G/uYP2EfSttKKQt296QMXCLz G0M8BkprwOfyw== From: Jeff Layton To: chuck.lever@oracle.com Cc: neilb@suse.de, linux-nfs@vger.kernel.org Subject: [RFC PATCH 2/3] nfsd: rework arguments to nfs4_set_delegation Date: Thu, 14 Jul 2022 11:28:18 -0400 Message-Id: <20220714152819.128276-3-jlayton@kernel.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220714152819.128276-1-jlayton@kernel.org> References: <20220714152819.128276-1-jlayton@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 We'll need the nfs4_open to vet the filename. Change nfs4_set_delegation to take the same arguments are nfs4_open_delegation. Signed-off-by: Jeff Layton --- fs/nfsd/nfs4state.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 4f81c0bbd27b..347794028c98 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -5260,10 +5260,12 @@ static int nfsd4_check_conflicting_opens(struct nfs4_client *clp, } static struct nfs4_delegation * -nfs4_set_delegation(struct nfs4_client *clp, - struct nfs4_file *fp, struct nfs4_clnt_odstate *odstate) +nfs4_set_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp) { int status = 0; + struct nfs4_client *clp = stp->st_stid.sc_client; + struct nfs4_file *fp = stp->st_stid.sc_file; + struct nfs4_clnt_odstate *odstate = stp->st_clnt_odstate; struct nfs4_delegation *dp; struct nfsd_file *nf; struct file_lock *fl; @@ -5405,7 +5407,7 @@ nfs4_open_delegation(struct nfsd4_open *open, struct nfs4_ol_stateid *stp) default: goto out_no_deleg; } - dp = nfs4_set_delegation(clp, stp->st_stid.sc_file, stp->st_clnt_odstate); + dp = nfs4_set_delegation(open, stp); if (IS_ERR(dp)) goto out_no_deleg; -- 2.36.1