summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJeff Layton <jeff.layton@primarydata.com>2019-08-18 14:18:55 -0400
committerJ. Bruce Fields <bfields@redhat.com>2019-08-19 11:09:09 -0400
commit6b556ca2872be223176c1a1e249606248ce0b201 (patch)
treecf150744784dee37af4ba8e3c379d2c079fb01bd /fs
parent5c4583b2b78eef4eb33fca9a4598e72e08dd514b (diff)
downloadlinux-stable-6b556ca2872be223176c1a1e249606248ce0b201.tar.gz
linux-stable-6b556ca2872be223176c1a1e249606248ce0b201.tar.bz2
linux-stable-6b556ca2872be223176c1a1e249606248ce0b201.zip
nfsd: have nfsd_test_lock use the nfsd_file cache
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com> Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/nfsd/nfs4state.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 17b1ad4a619f..906e214dcce8 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -6605,11 +6605,11 @@ out:
*/
static __be32 nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file_lock *lock)
{
- struct file *file;
- __be32 err = nfsd_open(rqstp, fhp, S_IFREG, NFSD_MAY_READ, &file);
+ struct nfsd_file *nf;
+ __be32 err = nfsd_file_acquire(rqstp, fhp, NFSD_MAY_READ, &nf);
if (!err) {
- err = nfserrno(vfs_test_lock(file, lock));
- fput(file);
+ err = nfserrno(vfs_test_lock(nf->nf_file, lock));
+ nfsd_file_put(nf);
}
return err;
}