Skip to content

Commit d67d1c7

Browse files
Felix BlyakherTrond Myklebust
authored andcommitted
nfs: set correct fl_len in nlmclnt_test()
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 <felixb@sgi.com> Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent c2e1b09 commit d67d1c7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/lockd/clntproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ nlmclnt_test(struct nlm_rqst *req, struct file_lock *fl)
430430
* Report the conflicting lock back to the application.
431431
*/
432432
fl->fl_start = req->a_res.lock.fl.fl_start;
433-
fl->fl_end = req->a_res.lock.fl.fl_start;
433+
fl->fl_end = req->a_res.lock.fl.fl_end;
434434
fl->fl_type = req->a_res.lock.fl.fl_type;
435435
fl->fl_pid = 0;
436436
break;

0 commit comments

Comments
 (0)