Skip to content

Commit

Permalink
nfs: set correct fl_len in nlmclnt_test()
Browse files Browse the repository at this point in the history
fcntl(F_GETLK) on an nfs client incorrectly returns
the values for the conflicting lock. fl_len value is
always 1.
If the conflicting lock is (0, 4095) the F_GETLK
request for (1024, 10) returns (0, 1), which doesn't
even cover the requested range, and is quite confusing.
The fix is trivial, set fl_end from the fl_end value
recieved from the nfs server.

Signed-off-by: Felix Blyakher <[email protected]>
Signed-off-by: "J. Bruce Fields" <[email protected]>
Signed-off-by: Trond Myklebust <[email protected]>
  • Loading branch information
Felix Blyakher authored and Trond Myklebust committed Jul 15, 2008
1 parent c2e1b09 commit d67d1c7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/lockd/clntproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ nlmclnt_test(struct nlm_rqst *req, struct file_lock *fl)
* Report the conflicting lock back to the application.
*/
fl->fl_start = req->a_res.lock.fl.fl_start;
fl->fl_end = req->a_res.lock.fl.fl_start;
fl->fl_end = req->a_res.lock.fl.fl_end;
fl->fl_type = req->a_res.lock.fl.fl_type;
fl->fl_pid = 0;
break;
Expand Down

0 comments on commit d67d1c7

Please sign in to comment.