Skip to content

Commit

Permalink
nfsd: have nfsd_test_lock use the nfsd_file cache
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff Layton authored and J. Bruce Fields committed Aug 19, 2019
1 parent 5c4583b commit 6b556ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -6605,11 +6605,11 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
*/
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;
}
Expand Down

0 comments on commit 6b556ca

Please sign in to comment.