Commit 70cc6487a4e08b8698c0e2ec935fb48d10490162

Authored by J. Bruce Fields
1 parent c2fa1b8a6c

locks: make ->lock release private data before returning in GETLK case

The file_lock argument to ->lock is used to return the conflicting lock
when found.  There's no reason for the filesystem to return any private
information with this conflicting lock, but nfsv4 is.

Fix nfsv4 client, and modify locks.c to stop calling fl_release_private
for it in this case.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Cc: "Trond Myklebust" <Trond.Myklebust@netapp.com>"

Showing 2 changed files with 1 additions and 4 deletions Side-by-side Diff

... ... @@ -1665,8 +1665,6 @@
1665 1665  
1666 1666 if (filp->f_op && filp->f_op->lock) {
1667 1667 error = filp->f_op->lock(filp, F_GETLK, &file_lock);
1668   - if (file_lock.fl_ops && file_lock.fl_ops->fl_release_private)
1669   - file_lock.fl_ops->fl_release_private(&file_lock);
1670 1668 if (error < 0)
1671 1669 goto out;
1672 1670 else
... ... @@ -1804,8 +1802,6 @@
1804 1802  
1805 1803 if (filp->f_op && filp->f_op->lock) {
1806 1804 error = filp->f_op->lock(filp, F_GETLK, &file_lock);
1807   - if (file_lock.fl_ops && file_lock.fl_ops->fl_release_private)
1808   - file_lock.fl_ops->fl_release_private(&file_lock);
1809 1805 if (error < 0)
1810 1806 goto out;
1811 1807 else
... ... @@ -3018,6 +3018,7 @@
3018 3018 case -NFS4ERR_DENIED:
3019 3019 status = 0;
3020 3020 }
  3021 + request->fl_ops->fl_release_private(request);
3021 3022 out:
3022 3023 up_read(&clp->cl_sem);
3023 3024 return status;