Skip to content

Commit 0bcc7ca

Browse files
J. Bruce Fieldschucklever
authored andcommitted
nfsd: fix crash on LOCKT on reexported NFSv3
Unlike other filesystems, NFSv3 tries to use fl_file in the GETLK case. Signed-off-by: J. Bruce Fields <[email protected]> Signed-off-by: Chuck Lever <[email protected]>
1 parent bb0a55b commit 0bcc7ca

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

fs/nfsd/nfs4state.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7043,8 +7043,7 @@ nfsd4_lock(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate,
70437043
/*
70447044
* The NFSv4 spec allows a client to do a LOCKT without holding an OPEN,
70457045
* so we do a temporary open here just to get an open file to pass to
7046-
* vfs_test_lock. (Arguably perhaps test_lock should be done with an
7047-
* inode operation.)
7046+
* vfs_test_lock.
70487047
*/
70497048
static __be32 nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct file_lock *lock)
70507049
{
@@ -7059,7 +7058,9 @@ static __be32 nfsd_test_lock(struct svc_rqst *rqstp, struct svc_fh *fhp, struct
70597058
NFSD_MAY_READ));
70607059
if (err)
70617060
goto out;
7061+
lock->fl_file = nf->nf_file;
70627062
err = nfserrno(vfs_test_lock(nf->nf_file, lock));
7063+
lock->fl_file = NULL;
70637064
out:
70647065
fh_unlock(fhp);
70657066
nfsd_file_put(nf);

0 commit comments

Comments
 (0)