From: Jeff Layton <jlayton@kernel.org>
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 [thread overview]
Message-ID: <20220714152819.128276-3-jlayton@kernel.org> (raw)
In-Reply-To: <20220714152819.128276-1-jlayton@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 <jlayton@kernel.org>
---
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
next prev parent reply other threads:[~2022-07-14 15:28 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-14 15:28 [RFC PATCH 0/3] nfsd: close potential race between open and setting delegation Jeff Layton
2022-07-14 15:28 ` [RFC PATCH 1/3] nfsd: drop fh argument from alloc_init_deleg Jeff Layton
2022-07-14 15:28 ` Jeff Layton [this message]
2022-07-14 16:47 ` [RFC PATCH 2/3] nfsd: rework arguments to nfs4_set_delegation Chuck Lever III
2022-07-14 17:12 ` Jeff Layton
2022-07-14 17:14 ` Chuck Lever III
2022-07-14 18:59 ` Jeff Layton
2022-07-14 15:28 ` [RFC PATCH 3/3] nfsd: vet the opened dentry after setting a delegation Jeff Layton
2022-07-14 16:53 ` Chuck Lever III
2022-07-14 17:11 ` Jeff Layton
2022-07-14 17:16 ` Chuck Lever III
2022-07-14 18:49 ` Jeff Layton
2022-07-18 21:18 ` [RFC PATCH 0/3] nfsd: close potential race between open and setting delegation J. Bruce Fields
2022-07-18 21:43 ` Jeff Layton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220714152819.128276-3-jlayton@kernel.org \
--to=jlayton@kernel.org \
--cc=chuck.lever@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox